← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1257507] Re: Glance v2: HTTP500 when updating image with locations

 

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

** Changed in: glance
    Milestone: None => icehouse-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/1257507

Title:
  Glance v2: HTTP500 when updating image with locations

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

Bug description:
  curl -i -X PATCH -H "X-Auth-Token: $AUTH_TOKEN" -H 'Content-Type:
  application/openstack-images-v2.1-json-patch' -H 'User-Agent: python-
  glanceclient' -d '[{"path": "/locations", "value":
  [{"url":"swift+http://service:glance:password@localhost:5000/v2.0/glance
  /d0d90e9b-82f2-43c4-9e12-232de00fa8ea", "metadata": {}}], "op":
  "replace"}]'
  http://localhost:9292/v2/images/7b724ba6-6451-4280-85e4-1c46b3e6e5b5

  HTTP/1.1 500 Internal Server Error


  2013-12-03 22:14:39.298 12510 INFO glance.wsgi.server [85024f66-9dd2-4289-98a2-f4b9f6426aae 1c3848b015f94b70866ea33fa52945f0 54bc4959075343ff80f460b77e783a49] Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/eventlet/wsgi.py", line 389, 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 581, 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 599, in __call__
      request, **action_args)
    File "/opt/stack/glance/glance/common/wsgi.py", line 618, in dispatch
      return method(*args, **kwargs)
    File "/opt/stack/glance/glance/common/utils.py", line 422, in wrapped
      return func(self, req, *args, **kwargs)
    File "/opt/stack/glance/glance/api/v2/images.py", line 119, in update
      change_method(req, image, change)
    File "/opt/stack/glance/glance/api/v2/images.py", line 149, in _do_replace
      self._do_replace_locations(image, value)
    File "/opt/stack/glance/glance/api/v2/images.py", line 228, in _do_replace_locations
      image.locations = value
    File "/opt/stack/glance/glance/domain/proxy.py", line 23, in set_attr
      return setattr(getattr(self, target), attr, value)
    File "/opt/stack/glance/glance/domain/proxy.py", line 23, in set_attr
      return setattr(getattr(self, target), attr, value)
    File "/opt/stack/glance/glance/api/policy.py", line 227, in locations
      self.image.locations = new_locations
    File "/opt/stack/glance/glance/quota/__init__.py", line 195, in locations
      self.context, self.image.size * len(value), self.db_api,
  TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'

  
  2013-12-03 22:14:39.301 12510 INFO glance.wsgi.server [85024f66-9dd2-4289-98a2-f4b9f6426aae 1c3848b015f94b70866ea33fa52945f0 54bc4959075343ff80f460b77e783a49] localhost - - [03/Dec/2013 22:14:39] "PATCH /v2/images/7b724ba6-6451-4280-85e4-1c46b3e6e5b5 HTTP/1.1" 500 139 0.421279

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


References