OpenStack API Create function fails with index out of range

Bug #704164 reported by Jordan Rinke
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Unassigned

Bug Description

Using the OpenStack API the Create function fails with a "list index out of range" error. This has been tried with multiple ImageID and FlavorIDs (numbers, strings etc)

OS: Ubuntu 10.10
Nova Version: 2011.1~bzr569-0ubuntu0ppa1~maverick3
Modifications: None

Request:

POST /v1.0/servers HTTP/1.1
X-Auth-Token: 9683e742c697f263a0d843e7f8b344c1d27dd549

{
   "server": {
       "name": "mike-test",
       "imageId": "ami-tty",
       "flavorId": "m1.small"
   }
}

Response:

HTTP/1.1 500 Internal Server Error
Content-Type: text/html; charset=UTF-8
Content-Length: 69
Date: Mon, 17 Jan 2011 21:20:17 GMT
Connection: close

{"computeFault": {"message": "list index out of range", "code": 500}}

nova-api.log:

(nova.api.openstack 2011.1-workspace:tarmac-20110115022500-fcgl1yga6csc221i): ERROR [N/A] Caught error: list index out of range
(nova.api.openstack): TRACE: Traceback (most recent call last):
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/nova/api/openstack/__init__.py", line 73, in __call__
(nova.api.openstack): TRACE: return req.get_response(self.application)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/request.py", line 919, in get_response
(nova.api.openstack): TRACE: application, catch_exc_info=False)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/request.py", line 887, in call_application
(nova.api.openstack): TRACE: app_iter = application(self.environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
(nova.api.openstack): TRACE: return resp(environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
(nova.api.openstack): TRACE: return resp(environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
(nova.api.openstack): TRACE: return resp(environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/routes/middleware.py", line 131, in __call__
(nova.api.openstack): TRACE: response = self.app(environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/dec.py", line 159, in __call__
(nova.api.openstack): TRACE: return resp(environ, start_response)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
(nova.api.openstack): TRACE: resp = self.call_func(req, *args, **self.kwargs)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
(nova.api.openstack): TRACE: return self.func(req, *args, **kwargs)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/nova/wsgi.py", line 265, in __call__
(nova.api.openstack): TRACE: result = method(**arg_dict)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/nova/api/openstack/servers.py", line 146, in create
(nova.api.openstack): TRACE: req.environ['nova.context'])[0]
(nova.api.openstack): TRACE: IndexError: list index out of range
(nova.api.openstack): TRACE:

Additonal info:
Results from images/flavors details

GET /images/detail
{"images": [{"status": "active", "id": 4498728160366123684, "name": "nova/tty-kernel"}, {"status": "active", "id": 9076875775488977738, "name": "nova/tty"}, {"status": "active", "id": 472304719163701353, "name": "nova/tty-ramdisk"}]}

GET /flavors/detail
{"flavors": [{"disk": 40, "ram": 4096, "name": "m1.medium", "id": 3}, {"disk": 0, "ram": 512, "name": "m1.tiny", "id": 1}, {"disk": 80, "ram": 8192, "name": "m1.large", "id": 4}, {"disk": 160, "ram": 16384, "name": "m1.xlarge", "id": 5}, {"disk": 20, "ram": 2048, "name": "m1.small", "id": 2}]}

Revision history for this message
Dan Prince (dan-prince) wrote :

It looks like this is failing because the key pair is missing. The existing Openstack API controller for Bexar requires a key pair to be present before a POST to create is usable.

Can you try sourcing your novarc file and then running a manual 'euca-add-keypair' command and see if that gets you past this issue?

Thierry Carrez (ttx)
Changed in nova:
status: New → Incomplete
Revision history for this message
Thierry Carrez (ttx) wrote :

@JordanRinke: any chance you could provide the requested information ? We can't really make progress on this without your input.

Revision history for this message
Brian Lamar (blamar) wrote :

The current OS API 'server create' logic handles this particular case so this bug should be fixed/closed?

Revision history for this message
Thierry Carrez (ttx) wrote :

Closing as Invalid, following last comment. Please reopen if you can still reproduce the issue.

Changed in nova:
status: Incomplete → Invalid
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.