Updating metadata of unauthorized image gives 500 error

Bug #1194768 reported by Pavel Kirpichyov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Pavel Kirpichyov

Bug Description

If user tries to update metadata of public image without write access nova generates 500 error with traceback to log:

2013-06-26 08:41:40.543 ERROR nova.api.openstack [req-7c23c891-e55f-4edd-9c2f-6b77518ea20f d3003e4f8edf470b97744ca1641e8fd6 ae5f2ee3e4174257977b8b0b4ed348ba] Caught error: Not authorized for image dd29b70d-e517-49ef-86a0-b4d7bf668056.
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack Traceback (most recent call last):
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/nova/api/openstack/__init__.py", line 81, in __call__
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack return req.get_response(self.application)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/webob/request.py", line 1296, in send
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack application, catch_exc_info=False)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/webob/request.py", line 1260, in call_application
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack app_iter = application(self.environ, start_response)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/webob/dec.py", line 144, in __call__
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack return resp(environ, start_response)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/keystoneclient/middleware/auth_token.py", line 451, in __call__
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack return self.app(env, start_response)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/webob/dec.py", line 144, in __call__
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack return resp(environ, start_response)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/webob/dec.py", line 144, in __call__
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack return resp(environ, start_response)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/webob/dec.py", line 144, in __call__
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack return resp(environ, start_response)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/Routes-1.12.3-py2.6.egg/routes/middleware.py", line 131, in __call__
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack response = self.app(environ, start_response)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/webob/dec.py", line 144, in __call__
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack return resp(environ, start_response)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/webob/dec.py", line 130, in __call__
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack resp = self.call_func(req, *args, **self.kwargs)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/webob/dec.py", line 195, in call_func
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack return self.func(req, *args, **kwargs)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/nova/api/openstack/wsgi.py", line 890, in __call__
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack content_type, body, accept)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/nova/api/openstack/wsgi.py", line 942, in _process_stack
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack action_result = self.dispatch(meth, request, action_args)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/nova/api/openstack/wsgi.py", line 1022, in dispatch
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack return method(req=request, **action_args)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/nova/api/openstack/compute/image_metadata.py", line 90, in update
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack self.image_service.update(context, image_id, image, None)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/nova/image/glance.py", line 315, in update
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack _reraise_translated_image_exception(image_id)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/nova/image/glance.py", line 313, in update
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack image_id, **image_meta)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/nova/image/glance.py", line 182, in call
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack return getattr(client.images, method)(*args, **kwargs)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/glanceclient/v1/images.py", line 288, in update
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack 'PUT', url, headers=hdrs, body=image_data)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/glanceclient/common/http.py", line 245, in raw_request
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack return self._http_request(url, method, **kwargs)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack File "/usr/lib/python2.6/site-packages/glanceclient/common/http.py", line 206, in _http_request
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack raise exc.from_response(resp, body_str)
2013-06-26 08:41:40.543 8259 TRACE nova.api.openstack ImageNotAuthorized: Not authorized for image dd29b70d-e517-49ef-86a0-b4d7bf668056.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/34512

Changed in nova:
assignee: nobody → Pavel Kirpichyov (pavel-kirpichyov)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/34512
Committed: http://github.com/openstack/nova/commit/d851b332a23b132b22d382bf97c27ff9e94f94a1
Submitter: Jenkins
Branch: master

commit d851b332a23b132b22d382bf97c27ff9e94f94a1
Author: Pavel Kirpichyov <email address hidden>
Date: Wed Jun 26 11:21:51 2013 +0300

    Handle ImageNotAuthorized exception

    Handle ImageNotAuthorized exception if user have no access to update image metadata

    Change-Id: I558cc2c31174f7f619061882bfdab6df35203254
    Fixes: bug #1194768

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-2 → 2013.2
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.