OpenStack Image Registry and Delivery Service (Glance)

keyerror: 'image' when doing nova image-list

Reported by Antony Messerli on 2011-10-20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Medium
Jay Pipes

Bug Description

Running 5ae43a0e15d8cdb0f217e5dd143834915c7d8fe6, I get the following when doing a nova image-list.

2011-10-20 22:03:36 DEBUG [routes.middleware] Matched GET /images/detail
2011-10-20 22:03:36 DEBUG [routes.middleware] Route path: '/images/detail', defaults: {'action': u'detail', 'controller': <glance.common.wsgi.Resource object at 0x1ad0450>}
2011-10-20 22:03:36 DEBUG [routes.middleware] Match dict: {'action': u'detail', 'controller': <glance.common.wsgi.Resource object at 0x1ad0450>}
2011-10-20 22:03:37 DEBUG [glance.api.middleware.cache] Tee'ing image 'detail' into cache
2011-10-20 22:03:37 DEBUG [eventlet.wsgi.server] Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/eventlet/wsgi.py", line 336, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/glance/common/wsgi.py", line 169, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 919, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 887, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/python2.6/dist-packages/keystone/middleware/auth_token.py", line 189, in __call__
    return self._forward_request(env, start_response, proxy_headers)
  File "/usr/lib/python2.6/dist-packages/keystone/middleware/auth_token.py", line 321, in _forward_request
    return self.app(env, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/glance/common/wsgi.py", line 169, in __call__
    response = req.get_response(self.application)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 919, in get_response
    application, catch_exc_info=False)
  File "/usr/lib/pymodules/python2.6/webob/request.py", line 887, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/pymodules/python2.6/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/glance/common/wsgi.py", line 170, in __call__
    return self.process_response(response)
  File "/usr/lib/pymodules/python2.6/glance/api/middleware/cache.py", line 141, in process_response
    image_id)
  File "/usr/lib/pymodules/python2.6/glance/registry/__init__.py", line 87, in get_image_metadata
    return c.get_image(image_id)
  File "/usr/lib/pymodules/python2.6/glance/registry/client.py", line 69, in get_image
    data = json.loads(res.read())['image']
KeyError: 'image'

Jay Pipes (jaypipes) wrote :

Problem is the regex is matching /images/detail and thinking "detail" is an image id...

Changed in glance:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Jay Pipes (jaypipes)
milestone: none → essex-1
Jay Pipes (jaypipes) on 2011-10-21
Changed in glance:
status: Confirmed → In Progress

Reviewed: https://review.openstack.org/1064
Committed: http://github.com/openstack/glance/commit/39c855743423175beca6955ed30c15b9c40f9129
Submitter: Jenkins
Branch: master

 status fixcommitted
 done

commit 39c855743423175beca6955ed30c15b9c40f9129
Author: Jay Pipes <email address hidden>
Date: Fri Oct 21 16:10:32 2011 -0400

    Adds Driver Layer to Image Cache

    Fixes LP Bug#879136 - keyerror: 'image' when doing nova image-list
    Fixes LP Bug#819936 - New image cache breaks Glance on Windows

    This patch refactors the image cache further by adding an
    adaptable driver layer to the cache. The existing filesystem-based
    driver that depended on python-xattr and conditional fstab support
    has been moved to /glance/image_cache/drivers/xattr.py, and a new
    default driver is now based on SQLite and has no special requirements.

    The image cache now contains a simple interface for pruning the
    cache. Instead of the logic being contained in
    /glance/image_cache/pruner.py, now the prune logic is self-contained
    within the ImageCache.prune() method, with pruning calling the
    simple well-defined driver methods of get_least_recently_accessed()
    and get_cache_size().

    Adds a functional test case for the caching middleware and adds
    documentation on how to configure the image cache drivers.

    TODO: cache-manage middleware...
    TODO: cache management docs

    Change-Id: Id7ae73549d6bb39222eb7ac0427b0083fd1af3ec

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2011-11-17
Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-04-05
Changed in glance:
milestone: essex-1 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers