500 error returned when an Admin tries to delete membership of image from a non-existent /invalid tenant

Bug #1060868 reported by Rohit Karajgi
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Medium
Unmesh Gurjar
Folsom
Fix Released
Medium
Eoghan Glynn
Grizzly
Fix Released
Medium
Unmesh Gurjar

Bug Description

Steps to reproduce
1. Add an image to a tenant
$ glance member-add --can-share a2bfa0c3-fb77-4da3-9a45-c0ed0debb1d5 127f00e1254f4efca0088913c8184a41
$ glance member-list --image-id a2bfa0c3-fb77-4da3-9a45-c0ed0debb1d5
+--------------------------------------+----------------------------------+-----------+
| Image ID | Member ID | Can Share |
+--------------------------------------+----------------------------------+-----------+
| a2bfa0c3-fb77-4da3-9a45-c0ed0debb1d5 | 127f00e1254f4efca0088913c8184a41 | True |
+--------------------------------------+----------------------------------+-----------+

2. Try to delete the membership of image from another, or an invalid instance:

Actual result: HTTP 500 Internal Server Error

$ curl -v -H "X-Auth-Token:752ba532d87a4a308587604832e92628" -H "Content-type: application/json" -X DELETE http://myglancehost:9292/v1/images/a2bfa0c3-fb77-4da3-9a45-c0ed0debb1d5/members/112323b253a54736g
* About to connect() to 10.2.3.102 port 9292 (#0)
* Trying 10.2.3.102... connected
> DELETE /v1/images/a2bfa0c3-fb77-4da3-9a45-c0ed0debb1d5/members/1 HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: 10.2.3.102:9292
> Accept: */*
> X-Auth-Token:752ba532d87a4a308587604832e92628
> Content-type: application/json
>
< HTTP/1.1 500 Internal Server Error
< Content-Type: text/plain
< Content-Length: 5073
< Date: Wed, 03 Oct 2012 09:37:25 GMT
< Connection: close
<
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/eventlet/wsgi.py", line 382, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/opt/stack/glance/glance/common/wsgi.py", line 326, in __call__
    response = req.get_response(self.application)
  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1053, in get_response
    application, catch_exc_info=False)
  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1022, in call_application
    app_iter = application(self.environ, start_response)
  File "/opt/stack/keystone/keystone/middleware/auth_token.py", line 278, in __call__
    return self.app(env, start_response)
  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/opt/stack/glance/glance/common/wsgi.py", line 326, in __call__
    response = req.get_response(self.application)
  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1053, in get_response
    application, catch_exc_info=False)
  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1022, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/opt/stack/glance/glance/common/wsgi.py", line 326, in __call__
    response = req.get_response(self.application)
  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1053, in get_response
    application, catch_exc_info=False)
  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1022, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/opt/stack/glance/glance/common/wsgi.py", line 326, in __call__
    response = req.get_response(self.application)
  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1053, in get_response
    application, catch_exc_info=False)
  File "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1022, in call_application
    app_iter = application(self.environ, start_response)
  File "/usr/lib/python2.7/dist-packages/paste/urlmap.py", line 203, in __call__
    return app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "/usr/lib/python2.7/dist-packages/routes/middleware.py", line 131, in __call__
    response = self.app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 159, in __call__
    return resp(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 147, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 208, in call_func
    return self.func(req, *args, **kwargs)
  File "/opt/stack/glance/glance/common/wsgi.py", line 532, in __call__
    request, **action_args)
  File "/opt/stack/glance/glance/common/wsgi.py", line 549, in dispatch
    return method(*args, **kwargs)
  File "/opt/stack/glance/glance/common/utils.py", line 408, in wrapped
    return func(self, req, *args, **kwargs)
  File "/opt/stack/glance/glance/api/v1/members.py", line 70, in delete
    registry.delete_member(req.context, image_id, id)
  File "/opt/stack/glance/glance/registry/__init__.py", line 177, in delete_member
    return c.delete_member(image_id, member_id)
  File "/opt/stack/glance/glance/registry/client.py", line 224, in delete_member
    (image_id, member_id))
  File "/opt/stack/glance/glance/registry/client.py", line 89, in do_request
    action, **kwargs)
  File "/opt/stack/glance/glance/common/client.py", line 63, in wrapped
    return func(self, *args, **kwargs)
  File "/opt/stack/glance/glance/common/client.py", line 374, in do_request
    headers=headers)
  File "/opt/stack/glance/glance/common/client.py", line 80, in wrapped
    return func(self, method, url, body, headers)
  File "/opt/stack/glance/glance/common/client.py", line 511, in _do_request
    raise exception.ServerError()
ServerError: The request returned 500 Internal Server Error.
* Closing connection #0

Expected Result: 404 Not Found for deleting membership from a non-existent or invalid tenant.

Tags: ntt
Changed in glance:
assignee: nobody → Unmesh Gurjar (unmesh-gurjar)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

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

Changed in glance:
status: New → In Progress
Changed in glance:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/14210
Committed: http://github.com/openstack/glance/commit/950e700b4fe69f001b228d11c8014ebbdfa7b10b
Submitter: Jenkins
Branch: master

commit 950e700b4fe69f001b228d11c8014ebbdfa7b10b
Author: Unmesh Gurjar <email address hidden>
Date: Tue Oct 9 03:06:00 2012 -0700

    Fixes deletion of invalid image member

    This fixes the 500 error on deleting an invalid/non-member tenant of an image.

    Fixes LP: #1060868

    Change-Id: I5a2dc56690d7525127be1a8843004d075a3fe5bb

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: none → grizzly-1
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (stable/folsom)

Fix proposed to branch: stable/folsom
Review: https://review.openstack.org/24116

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (stable/folsom)

Reviewed: https://review.openstack.org/24116
Committed: http://github.com/openstack/glance/commit/04f88c8d563ef1330d19679e8305ac6e107228f6
Submitter: Jenkins
Branch: stable/folsom

commit 04f88c8d563ef1330d19679e8305ac6e107228f6
Author: Unmesh Gurjar <email address hidden>
Date: Tue Oct 9 03:06:00 2012 -0700

    Fixes deletion of invalid image member

    This fixes the 500 error on deleting an invalid/non-member tenant of an image.

    Fixes LP: #1060868

    Change-Id: I5a2dc56690d7525127be1a8843004d075a3fe5bb

tags: added: in-stable-folsom
Alan Pevec (apevec)
tags: removed: in-stable-folsom
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.