← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1060868] Re: 500 error returned when an Admin tries to delete membership of image from a non-existent /invalid tenant

 

** Changed in: glance/folsom
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1060868

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

Status in OpenStack Image Registry and Delivery Service (Glance):
  Fix Released
Status in Glance folsom series:
  Fix Released
Status in Glance grizzly series:
  Fix Released

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1060868/+subscriptions