nova returns no status code for state scheduling

Bug #721254 reported by bobya
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Ken Pepple

Bug Description

We are trying to run new instances through AWS JAVA SDK. the instance starts normally, but the response from the server breaks the API . Here is the exact exception:

578 [main] ERROR com.amazonaws.http.HttpClient - Unable to unmarshall response (For input string: ""):
java.lang.NumberFormatException: For input string: ""
 at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
 at java.lang.Integer.parseInt(Integer.java:470)
 at java.lang.Integer.parseInt(Integer.java:499)
 at com.amazonaws.transform.SimpleTypeStaxUnmarshallers$IntegerStaxUnmarshaller.unmarshall(SimpleTypeStaxUnmarshallers.java:77)
 at com.amazonaws.services.ec2.model.transform.InstanceStateStaxUnmarshaller.unmarshall(InstanceStateStaxUnmarshaller.java:51)
 at com.amazonaws.services.ec2.model.transform.InstanceStaxUnmarshaller.unmarshall(InstanceStaxUnmarshaller.java:59)
 at com.amazonaws.services.ec2.model.transform.ReservationStaxUnmarshaller.unmarshall(ReservationStaxUnmarshaller.java:67)
 at com.amazonaws.services.ec2.model.transform.DescribeInstancesResultStaxUnmarshaller.unmarshall(DescribeInstancesResultStaxUnmarshaller.java:51)
 at com.amazonaws.services.ec2.model.transform.DescribeInstancesResultStaxUnmarshaller.unmarshall(DescribeInstancesResultStaxUnmarshaller.java:33)
 at com.amazonaws.http.StaxResponseHandler.handle(StaxResponseHandler.java:126)
 at com.amazonaws.http.StaxResponseHandler.handle(StaxResponseHandler.java:36)
 at com.amazonaws.http.HttpClient.handleResponse(HttpClient.java:383)
 at com.amazonaws.http.HttpClient.execute(HttpClient.java:157)
 at com.amazonaws.services.ec2.AmazonEC2Client.invoke(AmazonEC2Client.java:3639)
 at com.amazonaws.services.ec2.AmazonEC2Client.describeInstances(AmazonEC2Client.java:456)
 at com.amazonaws.services.ec2.AmazonEC2Client.describeInstances(AmazonEC2Client.java:3061)
 at com.sap.qa.Connect.main(Connect.java:112)

xmlns="http://ec2.amazonaws.com/doc/2010-06-15/"><requestId>AZ8DPR5PW3NEDR52MI7W</requestId><ownerId>Main</ownerId><groupSet><item><groupId>default</groupId></item></groupSet><reservationId>r-dw1p8hys</reservationId><instancesSet><item><displayDescription/><displayName>Server 6</displayName><keyName>None (Main, None)</keyName><instanceId>i-00000006</instanceId><instanceState><code/><name>scheduling</name></instanceState><publicDnsName/><imageId>ami-crgu85uu</imageId><productCodesSet/><privateDnsName/><dnsName/><launchTime>2011-02-14 19:31:41.194843</launchTime><placement><availabilityZone>unknown zone</availabilityZone></placement><amiLaunchIndex>0</amiLaunchIndex><instanceType>m1.small</instanceType></item></instancesSet></RunInstancesResponse>

The exact problem in the response that breaks the API is that the return status code does not contain any number it is just <code/> and this doesn't pass the integer parser in the AWS SDK.

could you please change the behavior so that a status code is returned for every status. Thanks

Related branches

Ken Pepple (ken-pepple)
Changed in nova:
assignee: nobody → Ken Pepple (ken-pepple)
status: New → In Progress
Thierry Carrez (ttx)
Changed in nova:
importance: Undecided → Medium
Revision history for this message
bobya (bobya) wrote :

Hi Ken,
I see you've taken this bug also :)
As it took some time we did some investigation and found out that the problem comes from the default options set at the beginning. They are located in "nova/compute/api.py"

We added a line like this:

.................
base_options = {
            'reservation_id': utils.generate_uid('r'),
            'image_id': image_id,
            'kernel_id': kernel_id or '',
            'ramdisk_id': ramdisk_id or '',
+++ 'state': '0',
            'state_description': 'scheduling',
.................

after that every new instance that we started had the code "0" for the scheduling state.

As I am not sure this is the correct way to fix it I am only suggesting here the method we found.

Revision history for this message
Ken Pepple (ken-pepple) wrote :

bobya -- sorry for the delay. yes, i believe that is the correct short term fix. pushing for merge into trunk.

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → 2011.2
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.