Glance returns HTTPInternalServerError 500 in case of image server is down

Bug #1379798 reported by Ankit Agrawal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Low
Ankit Agrawal
glance_store
Fix Released
Low
Ankit Agrawal

Bug Description

HTTPInternalServerError 500 response is returned to the user while image server is down during downloading the image.
When user tries to download the image from the remote location (image server) which is down, Connection refused ECONNREFUSED error is raised on the glance server.

Ideally it should return 503 HTTPServiceUnavailable response to the user.

Steps to reproduce:

1. Create a file 'test_image.py' at any location. example: /home/openstack/
2. Run Simple HTTP server using "python -m SimpleHTTPServer 8050" from location mentioned in step 1.
3. Create an image using location parameter.
example: glance image-create --name myimage --disk-format=raw --container-format=bare --location http://10.69.4.178:8050/test_image.py
4. Stop Simple HTTP server.
5. Download image using glance image-download <image_id> created in step 3.

Please refer http://paste.openstack.org/show/120165/ for v1 and v2 api logs.

Tags: ntt
Changed in glance:
assignee: nobody → Ankit Agrawal (ankitagrawal)
Changed in glance:
status: New → Triaged
importance: Undecided → Low
Changed in glance-store:
status: New → Triaged
importance: Undecided → Low
Changed in glance:
assignee: Ankit Agrawal (ankitagrawal) → tcs_openstack_group (tcs-openstack-group)
assignee: tcs_openstack_group (tcs-openstack-group) → Abhishek Talwar (abhishek-talwar)
status: Triaged → In Progress
Changed in glance-store:
assignee: nobody → Ankit Agrawal (ankitagrawal)
Changed in glance-store:
status: Triaged → In Progress
Changed in glance:
assignee: Abhishek Talwar (abhishek-talwar) → nobody
Changed in glance:
assignee: nobody → Ankit Agrawal (ankitagrawal)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance_store (master)

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

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance_store (master)

Reviewed: https://review.openstack.org/138306
Committed: https://git.openstack.org/cgit/openstack/glance_store/commit/?id=e6b5e8bb34df7c74e1ed248e9d5414c74b04ce1d
Submitter: Jenkins
Branch: master

commit e6b5e8bb34df7c74e1ed248e9d5414c74b04ce1d
Author: ankitagrawal <email address hidden>
Date: Thu Oct 16 05:15:46 2014 -0700

    Raise appropriate exception if socket error occurs

    Added a custom exception RemoteServiceUnavailable in
    glance_store.exceptions and raised it from "get" method of http store
    in case of socket.error exception is found.

    Moved mocking httplib request and response logic from setup method
    to a private method and called it only from the unit test cases where
    it is required.

    Partial-Bug: #1379798
    Change-Id: I065b9a3e8e674ea74ff8563aad99d7d022417caa

Changed in glance-store:
status: In Progress → Fix Released
Changed in glance:
milestone: none → kilo-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/138657
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=6982284218a95d5ddc2625b53ebfc684720c0447
Submitter: Jenkins
Branch: master

commit 6982284218a95d5ddc2625b53ebfc684720c0447
Author: ankitagrawal <email address hidden>
Date: Fri Oct 10 08:17:17 2014 -0700

    Glance returns HTTP 500 for image download

    HTTPInternalServerError 500 response is returned to the user while
    image server is down during downloading the image. When glance tries
    to download the image from the remote location (image server) which
    is down, Connection refused ECONNREFUSED error is raised on the
    glance server.

    Raised RemoteServiceUnavailable exception from glance_store and handle
    it in v1 and v2 api's to return 503 HTTPServiceUnavailable response
    to user.

    Note: Please refer below link to check glance_store related changes
    which addresses this issue partially.
    I065b9a3e8e674ea74ff8563aad99d7d022417caa

    Closes-Bug: #1379798
    Change-Id: I45099153e75d53b028e249fad8a4d944d38adf65

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: kilo-3 → 2015.1.0
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.