Client stack traces when 403 is returned by server for /file

Bug #1523612 reported by Stuart McLaren on 2015-12-07
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Undecided
Stuart McLaren
Liberty
Undecided
Unassigned

Bug Description

If the server returns a 403 response to a get on /file (may happen if the image is deactivated).

the client stack traces

Traceback (most recent call last):
  File "/mnt/sam/git/python-glanceclient/glanceclient/shell.py", line 605, in main
    args.func(client, args)
  File "/mnt/sam/git/python-glanceclient/glanceclient/v2/shell.py", line 278, in do_image_download
    body = gc.images.data(args.id)
  File "/mnt/sam/git/python-glanceclient/glanceclient/v2/images.py", line 194, in data
    resp, body = self.http_client.get(url)
  File "/mnt/sam/git/python-glanceclient/glanceclient/common/http.py", line 285, in get
    return self._request('GET', url, **kwargs)
  File "/mnt/sam/git/python-glanceclient/glanceclient/common/http.py", line 277, in _request
    resp, body_iter = self._handle_response(resp)
  File "/mnt/sam/git/python-glanceclient/glanceclient/common/http.py", line 93, in _handle_response
    raise exc.from_response(resp, resp.content)
HTTPForbidden: 403 Forbidden: The requested image is in status queued. Image data download is forbidden. (HTTP 403)
403 Forbidden: The requested image is in status queued. Image data download is forbidden. (HTTP 403)

Changed in python-glanceclient:
assignee: nobody → Stuart McLaren (stuart-mclaren)

Fix proposed to branch: master
Review: https://review.openstack.org/254328

Changed in python-glanceclient:
status: New → In Progress
Stuart McLaren (stuart-mclaren) wrote :

To reproduce:

Mark an image as 'deactivated' and:

glance --debug --os-image-api-version 2 image-download 61d51303-8ae9-42b9-bfd3-ee8124f1b90a > /dev/null

Reviewed: https://review.openstack.org/254328
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=5b9f21b38b59322d6c9423aa4f5b028e72dd01f6
Submitter: Jenkins
Branch: master

commit 5b9f21b38b59322d6c9423aa4f5b028e72dd01f6
Author: Stuart McLaren <email address hidden>
Date: Mon Dec 7 16:46:54 2015 +0000

    Handle 403 forbidden on download

    A download of a deactivated image may result in a 403.
    The cli should catch this error rather than stack trace.

    We also catch other unexpected http responses.

    Change-Id: If33fbc3a56cdb02b3ab32a6479a67fff20b4b1a9
    Closes-bug: 1523612

Changed in python-glanceclient:
status: In Progress → Fix Released

Change abandoned by Erno Kuvaja (<email address hidden>) on branch: stable/liberty
Review: https://review.openstack.org/290512
Reason: I agree with Flavio abandoning this.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers