← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1431652] Re: os-volume_attachments return 500 error code instead of 404 if invalid volume is specified

 

** Project changed: nova => python-cinderclient

** Changed in: python-cinderclient
       Status: Invalid => Confirmed

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1431652

Title:
  os-volume_attachments return 500 error code instead of 404 if invalid
  volume is specified

Status in Python client library for Cinder:
  Confirmed

Bug description:
  If I do a DELETE of os-volume_attachments with invalid volume, 500
  error code is being returned instead of 404.

  The problem is at volume = self.volume_api.get(context, volume_id)
  where NotFound exception is  not being handled. This problem is fixed
  in v3 API.

  2015-03-12 08:49:19.146 20273 INFO nova.osapi_compute.wsgi.server [req-001f6e6e-4726-4738-a3e7-74c5c7eaaac5 None] 9.114.193.249,127.0.0.1 "DELETE /v2/dd069270f6634cafaf66777c4a2ee137/servers/e44ee780-0b57-4bcb-89ef-ab99e4d7d1a0/os-volume_attachments/volume-815308985 HTTP/1.1" status: 500 len: 295 time: 0.6408780
  ...
  2015-03-12 08:49:18.969 20273 ERROR nova.api.openstack [req-001f6e6e-4726-4738-a3e7-74c5c7eaaac5 None] Caught error: Not Found (HTTP 404) (Request-ID: req-8d133de9-430e-41ad-819a-3f9685deed29)
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack Traceback (most recent call last):
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/nova/api/openstack/__init__.py", line 125, in __call__
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack     return req.get_response(self.application)
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/webob/request.py", line 1296, in send
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack     application, catch_exc_info=False)
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/webob/request.py", line 1260, in call_application
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack     app_iter = application(self.environ, start_response)
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack     return resp(environ, start_response)
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/keystonemiddleware/auth_token.py", line 748, in __call__
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack     return self._call_app(env, start_response)
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/keystonemiddleware/auth_token.py", line 684, in _call_app
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack     return self._app(env, _fake_start_response)
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/webob/dec.py", line 144, in __call__
  ...
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/nova/api/openstack/compute/contrib/volumes.py", line 398, in delete
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack     volume = self.volume_api.get(context, volume_id)
  ...
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack     item = cinder.cinderclient(context).volumes.get(volume_id)
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/cinderclient/v2/volumes.py", line 227, in get
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack     return self._get("/volumes/%s" % volume_id, "volume")
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/cinderclient/base.py", line 149, in _get
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack     resp, body = self.api.client.get(url)
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/cinderclient/client.py", line 88, in get
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack     return self._cs_request(url, 'GET', **kwargs)
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/cinderclient/client.py", line 85, in _cs_request
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack     return self.request(url, method, **kwargs)
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/cinderclient/client.py", line 80, in request
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack     return super(SessionClient, self).request(*args, **kwargs)
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/keystoneclient/adapter.py", line 166, in request
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack     resp = super(LegacyJsonAdapter, self).request(*args, **kwargs)
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/keystoneclient/adapter.py", line 89, in request
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack     return self.session.request(url, method, **kwargs)
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/keystoneclient/utils.py", line 318, in inner
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack     return func(*args, **kwargs)
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack   File "/usr/lib/python2.7/site-packages/keystoneclient/session.py", line 363, in request
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack     raise exceptions.from_response(resp, method, url)
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack NotFound: Not Found (HTTP 404) (Request-ID: req-8d133de9-430e-41ad-819a-3f9685deed29)
  2015-03-12 08:49:18.969 20273 TRACE nova.api.openstack
  2015-03-12 08:49:19.145 20273 INFO nova.api.openstack [req-001f6e6e-4726-4738-a3e7-74c5c7eaaac5 None] http://localhost:8774/v2/dd069270f6634cafaf66777c4a2ee137/servers/e44ee780-0b57-4bcb-89ef-ab99e4d7d1a0/os-volume_attachments/volume-815308985 returned with HTTP 500

To manage notifications about this bug go to:
https://bugs.launchpad.net/python-cinderclient/+bug/1431652/+subscriptions


References