Downloading empty file with enabled cache management leads to 500 error

Bug #1533150 reported by Mike Fedosin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
In Progress
Undecided
Darja Shakhray
Liberty
New
Undecided
Unassigned

Bug Description

When I tried to download an empty image file from glance with enabled cache management I got 500 error:

mfedosin@wdev:~$ glance --debug image-download 0af7b2e8-8e31-427b-a99f-9117f45418ef --file empty_file
curl -g -i -X GET -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'User-Agent: python-glanceclient' -H 'Connection: keep-alive' -H 'X-Auth-Token: {SHA1}c91066a8c438769ed454eebd759b4f8b1e488cb6' -H 'Content-Type: application/octet-stream' http://10.0.2.15:9292/v2/images/0af7b2e8-8e31-427b-a99f-9117f45418ef/file
Request returned failure status 500.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/shell.py", line 605, in main
    args.func(client, args)
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/shell.py", line 277, in do_image_download
    body = gc.images.data(args.id)
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/images.py", line 194, in data
    resp, body = self.http_client.get(url)
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", line 284, in get
    return self._request('GET', url, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", line 276, in _request
    resp, body_iter = self._handle_response(resp)
  File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", line 93, in _handle_response
    raise exc.from_response(resp, resp.content)
HTTPInternalServerError: HTTPInternalServerError (HTTP 500)
HTTPInternalServerError (HTTP 500)

Without cache management everything works fine.

Steps to reproduce on devstack:

1. Set flavor to 'keystone+cachemanagement' in glance-api.conf (flavor = keystone+cachemanagement)
2. Restart glance-api server
3. Create an image with empty file (file size is 0)
4. Try to download the image file from glance.

Expected result: new empty file will be created in local folder.

Actual result: HTTPInternalServerError (HTTP 500)

Logs from glance-api: http://paste.openstack.org/show/483545/

Changed in glance:
assignee: nobody → Darja Shakhray (dshakhray)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

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

Changed in glance:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on glance (master)

Change abandoned by Darja Shakhray (<email address hidden>) on branch: master
Review: https://review.openstack.org/266891
Reason: This commit is not necessary

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Ian Cordasco (<email address hidden>) on branch: master
Review: https://review.openstack.org/269277
Reason: As discussed on the other patch, this is unnecessary

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.