← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1185055] Re: Create image API should not expose any trace when the image location is wrong

 

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

** Changed in: glance
    Milestone: None => havana-2

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

Title:
  Create image API  should not expose any trace when the image location
  is wrong

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

Bug description:
  Issue: Glance image create API returns traces instead of HTTP error

  X-Auth-Token:  ****

  x-image-meta-name: test-image-sce-88
  x-image-meta-disk-format: qcow2
  x-image-meta-container-format: bare
  x-glance-api-copy-from:   http://192.168.56.101:8080/myapp222/cirros.img   (note: the image location is fake)

  Post body: {}

  The response entity got from openstack is as following,

  the error message is 'Traceback (most recent call last): File
  "/usr/local/lib/python2.7/dist-packages/eventlet/wsgi.py", line 383,
  in handle_one_response result = self.application(self.environ,
  start_response) File "/usr/local/lib/python2.7/dist-
  packages/webob/dec.py", line 130, in __call__ resp =
  self.call_func(req, *args, **self.kwargs) File
  "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in
  call_func return self.func(req, *args, **kwargs) File
  "/opt/stack/glance/glance/common/wsgi.py", line 367, in __call__
  response = req.get_response(self.application) File
  "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1296,
  in send application, catch_exc_info=False) File
  "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1260,
  in call_application app_iter = application(self.environ,
  start_response) File "/opt/stack/python-
  keystoneclient/keystoneclient/middleware/auth_token.py", line 451, in
  __call__ return self.app(env, start_response) File
  "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in
  __call__ resp = self.call_func(req, *args, **self.kwargs) File
  "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in
  call_func return self.func(req, *args, **kwargs) File
  "/opt/stack/glance/glance/common/wsgi.py", line 367, in __call__
  response = req.get_response(self.application) File
  "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1296,
  in send application, catch_exc_info=False) File
  "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1260,
  in call_application app_iter = application(self.environ,
  start_response) File "/usr/local/lib/python2.7/dist-
  packages/webob/dec.py", line 130, in __call__ resp =
  self.call_func(req, *args, **self.kwargs) File
  "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in
  call_func return self.func(req, *args, **kwargs) File
  "/opt/stack/glance/glance/common/wsgi.py", line 367, in __call__
  response = req.get_response(self.application) File
  "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1296,
  in send application, catch_exc_info=False) File
  "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1260,
  in call_application app_iter = application(self.environ,
  start_response) File "/usr/local/lib/python2.7/dist-
  packages/webob/dec.py", line 130, in __call__ resp =
  self.call_func(req, *args, **self.kwargs) File
  "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in
  call_func return self.func(req, *args, **kwargs) File
  "/opt/stack/glance/glance/common/wsgi.py", line 367, in __call__
  response = req.get_response(self.application) File
  "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1296,
  in send application, catch_exc_info=False) File
  "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1260,
  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 144, 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 144, in __call__ return resp(environ,
  start_response) File "/usr/local/lib/python2.7/dist-
  packages/webob/dec.py", line 130, in __call__ resp =
  self.call_func(req, *args, **self.kwargs) File
  "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in
  call_func return self.func(req, *args, **kwargs) File
  "/opt/stack/glance/glance/common/wsgi.py", line 589, in __call__
  request, **action_args) File
  "/opt/stack/glance/glance/common/wsgi.py", line 606, in dispatch
  return method(*args, **kwargs) File
  "/opt/stack/glance/glance/common/utils.py", line 418, in wrapped
  return func(self, req, *args, **kwargs) File
  "/opt/stack/glance/glance/api/v1/images.py", line 697, in create
  location_uri = image_meta.get('location') AttributeError: 'NoneType'
  object has no attribute 'get' '. The service responded with the
  following status: 500 - Traceback (most recent call last): File
  "/usr/local/lib/python2.7/dist-packages/eventlet/wsgi.py", line 383,
  in handle_one_response result = self.application(self.environ,
  start_response) File "/usr/local/lib/python2.7/dist-
  packages/webob/dec.py", line 130, in __call__ resp =
  self.call_func(req, *args, **self.kwargs) File
  "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in
  call_func return self.func(req, *args, **kwargs) File
  "/opt/stack/glance/glance/common/wsgi.py", line 367, in __call__
  response = req.get_response(self.application) File
  "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1296,
  in send application, catch_exc_info=False) File
  "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1260,
  in call_application app_iter = application(self.environ,
  start_response) File "/opt/stack/python-
  keystoneclient/keystoneclient/middleware/auth_token.py", line 451, in
  __call__ return self.app(env, start_response) File
  "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 130, in
  __call__ resp = self.call_func(req, *args, **self.kwargs) File
  "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in
  call_func return self.func(req, *args, **kwargs) File
  "/opt/stack/glance/glance/common/wsgi.py", line 367, in __call__
  response = req.get_response(self.application) File
  "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1296,
  in send application, catch_exc_info=False) File
  "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1260,
  in call_application app_iter = application(self.environ,
  start_response) File "/usr/local/lib/python2.7/dist-
  packages/webob/dec.py", line 130, in __call__ resp =
  self.call_func(req, *args, **self.kwargs) File
  "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in
  call_func return self.func(req, *args, **kwargs) File
  "/opt/stack/glance/glance/common/wsgi.py", line 367, in __call__
  response = req.get_response(self.application) File
  "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1296,
  in send application, catch_exc_info=False) File
  "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1260,
  in call_application app_iter = application(self.environ,
  start_response) File "/usr/local/lib/python2.7/dist-
  packages/webob/dec.py", line 130, in __call__ resp =
  self.call_func(req, *args, **self.kwargs) File
  "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in
  call_func return self.func(req, *args, **kwargs) File
  "/opt/stack/glance/glance/common/wsgi.py", line 367, in __call__
  response = req.get_response(self.application) File
  "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1296,
  in send application, catch_exc_info=False) File
  "/usr/local/lib/python2.7/dist-packages/webob/request.py", line 1260,
  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 144, 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 144, in __call__ return resp(environ,
  start_response) File "/usr/local/lib/python2.7/dist-
  packages/webob/dec.py", line 130, in __call__ resp =
  self.call_func(req, *args, **self.kwargs) File
  "/usr/local/lib/python2.7/dist-packages/webob/dec.py", line 195, in
  call_func return self.func(req, *args, **kwargs) File
  "/opt/stack/glance/glance/common/wsgi.py", line 589, in __call__
  request, **action_args) File
  "/opt/stack/glance/glance/common/wsgi.py", line 606, in dispatch
  return method(*args, **kwargs) File
  "/opt/stack/glance/glance/common/utils.py", line 418, in wrapped
  return func(self, req, *args, **kwargs) File
  "/opt/stack/glance/glance/api/v1/images.py", line 697, in create
  location_uri = image_meta.get('location') AttributeError: 'NoneType'
  object has no attribute 'get'

  
  Expected result:
  Glance should return a firiendly API response for API users.

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