List images through Openstack API returns HTTP 500

Bug #749972 reported by Jeffrey Wilcox
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Critical
Brian Lamar

Bug Description

Using the following image:
 wget http://uec-images.ubuntu.com/lucid/current/lucid-server-uec-amd64.tar.gz
 uec-publish-tarball lucid-server-uec-amd64.tar.gz mybucket

I can list the images with the EC2 API with no trouble. But when I try the same thing with the Openstack API (using the openstack.compute wrapper library) it blows up. I traced through the openstack.compute API client, and it appears to be sending the right request per the OpenStack Compute DevGuide 3/1/11 (DRAFT) section 4.5.1.

 'http://192.168.200.50:8774/v1.0/images', 'GET', <<Authentication stuff>>
  or
 'http://192.168.200.50:8774/v1.1/images', 'GET', <<Authentication stuff>>
 (or the same with /images/detail).

I get back a HTTP 500 internal server error. In the nova-api log, I see that the cause of that is nova/api/openstack/views/images.py blowing up in the build function where it's trying to set "name": image_obj["name"].

Here's the stack trace:
-------------------------------------------------------------
2011-04-04 11:54:51,520 DEBUG routes.middleware [-] Matched GET /images from (pid=4135) __call__ /usr/lib/pymodules/python2.6/routes/middleware.py:100
2011-04-04 11:54:51,521 DEBUG routes.middleware [-] Route path: '/images', defaults: {'action': u'index', 'controller': <nova.api.openstack.images.ControllerV10 object at 0x2d61550>} from (pid=4135) __call__ /usr/lib/pymodules/python2.6/routes/middleware.py:102
2011-04-04 11:54:51,521 DEBUG routes.middleware [-] Match dict: {'action': u'index', 'controller': <nova.api.openstack.images.ControllerV10 object at 0x2d61550>} from (pid=4135) __call__ /usr/lib/pymodules/python2.6/routes/middleware.py:103
2011-04-04 11:54:51,522 ERROR nova.api.openstack [-] Caught error: 'name'
(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 58, 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 354, in __call__
(nova.api.openstack): TRACE: result = method(**arg_dict)
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/nova/api/openstack/images.py", line 68, in index
(nova.api.openstack): TRACE: return dict(images=[builder(image, detail=False) for image in images])
(nova.api.openstack): TRACE: File "/usr/lib/pymodules/python2.6/nova/api/openstack/views/images.py", line 64, in build
(nova.api.openstack): TRACE: "name": image_obj["name"],
(nova.api.openstack): TRACE: KeyError: 'name'

Related branches

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

Confirmed with python-novaclient:

$ nova image-list
'name' (HTTP 500)

Changed in nova:
importance: Undecided → Critical
status: New → Confirmed
Brian Lamar (blamar)
Changed in nova:
assignee: nobody → Brian Lamar (blamar)
Revision history for this message
Brian Lamar (blamar) wrote :

While I cannot reproduce with the latest glance, and returning an image without a name is unhelpful to the user (and in my mind a slightly large/more pressing issue) I realize that the API shouldn't 'blow up' when encountering an image without a name! :)

I should have a fix ready in a minute after checking to make sure other values aren't suffering from the assumption that they should...exist?

Brian Lamar (blamar)
Changed in nova:
status: Confirmed → In Progress
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → 2011.2
status: Fix Committed → Fix Released
Revision history for this message
pramod (p-rathor) wrote :

facing the same issue ...How to get the fix?

Revision history for this message
Brian Waldon (bcwaldon) wrote :

The only answer here is to upgrade to Diablo or Essex.

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.