← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1210284] Re: python-glanceclient should not stack trace on a "Forbidden to update deleted image."

 

This is not bug in glanceclient but bug in nova not catching the
exception from glanceclient:

devstack-02 :: ~/python-glanceclient ‹master› % tools/with_venv.sh python                                                                              2 ↵
venv develop-inst-nodeps: /home/ubuntu/python-glanceclient
venv runtests: commands[0] | python
Python 2.7.3 (default, Dec 18 2014, 19:10:20)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from glanceclient import client
>>> cl = client.Client(1, endpoint="http://localhost:9292";, token="<MYTOKEN>")
>>> image = cl.images.get("a95009af-8bf4-4a38-8d0d-1f795d5f93bf")
>>> try:
...     image.update(properties={'hello':'world'})
... except Exception as e:
...     print e
...
403 Forbidden: Forbidden to update deleted image. (HTTP 403)
>>>


** Also affects: nova
   Importance: Undecided
       Status: New

** Changed in: python-glanceclient
       Status: Triaged => Invalid

** Changed in: python-glanceclient
   Importance: High => Undecided

-- 
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/1210284

Title:
  python-glanceclient should not stack trace on a "Forbidden to update
  deleted image."

Status in OpenStack Compute (Nova):
  New
Status in Python client library for Glance:
  Invalid

Bug description:
  Through nova's use of python-glanceclient it stacktraces on a 403
  error for "Forbidden to update deleted image."

  
  /opt/stack/new/python-glanceclient/glanceclient/common/http.py:141
  2013-08-08 19:32:41.298 20079 DEBUG glanceclient.common.http [-] 
  HTTP/1.1 403 Forbidden
  date: Thu, 08 Aug 2013 19:32:41 GMT
  content-length: 54
  content-type: text/plain; charset=UTF-8
  x-openstack-request-id: req-66289b77-f291-4911-8e15-5b978aae99cc

  403 Forbidden

  Forbidden to update deleted image.

     
   log_http_response /opt/stack/new/python-glanceclient/glanceclient/common/http.py:151
  2013-08-08 19:32:41.298 20079 ERROR glanceclient.common.http [-] Request returned failure status.
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/eventlet/hubs/poll.py", line 97, in wait
      readers.get(fileno, noop).cb(fileno)
    File "/opt/stack/new/nova/nova/image/s3.py", line 379, in delayed_create
      purge_props=False)
    File "/opt/stack/new/nova/nova/image/glance.py", line 372, in update
      _reraise_translated_image_exception(image_id)
    File "/opt/stack/new/nova/nova/image/glance.py", line 370, in update
      image_id, **image_meta)
    File "/opt/stack/new/nova/nova/image/glance.py", line 201, in call
      return getattr(client.images, method)(*args, **kwargs)
    File "/opt/stack/new/python-glanceclient/glanceclient/v1/images.py", line 291, in update
      'PUT', url, headers=hdrs, body=image_data)
    File "/opt/stack/new/python-glanceclient/glanceclient/common/http.py", line 273, in raw_request
      return self._http_request(url, method, **kwargs)
    File "/opt/stack/new/python-glanceclient/glanceclient/common/http.py", line 234, in _http_request
      raise exc.from_response(resp, body_str)
  ImageNotAuthorized: Not authorized for image 7f0e42fb-e0aa-4b25-960c-29345bd827fa.
  Removing descriptor: 13
  2013-08-08 19:32:41.330 20079 DEBUG glanceclient.common.http [-] 
  HTTP/1.1 200 OK
  date: Thu, 08 Aug 2013 19:32:41 GMT
  content-length: 0
  content-type: text/html; charset=UTF-8
  x-openstack-request-id: req-52106bcc-465f-457a-bd19-40319055abad

  http://logs.openstack.org/64/40764/3/check/gate-tempest-devstack-vm-
  full/95753f5/logs/screen-n-api.txt.gz

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