download error when the image status is not active

Bug #1472449 reported by Long Quan Sha
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Medium
Darja Shakhray
Liberty
Fix Committed
Undecided
Unassigned
Glance Client
Fix Released
Medium
Long Quan Sha
Liberty
New
Undecided
Unassigned

Bug Description

When the locations is blank, downloading image will show python error, but the error message is not correct.

[root@vm134 pe]# glance image-show 9be94a27-367f-4a26-ae7a-045db3cb7332
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | None |
| container_format | None |
| created_at | 2015-07-02T09:09:22Z |
| disk_format | None |
| id | 9be94a27-367f-4a26-ae7a-045db3cb7332 |
| locations | [] |
| min_disk | 0 |
| min_ram | 0 |
| name | test |
| owner | e4b36a5b654942328943a835339a6289 |
| protected | False |
| size | None |
| status | queued |
| tags | [] |
| updated_at | 2015-07-02T09:09:22Z |
| virtual_size | None |
| visibility | private |
+------------------+--------------------------------------+
[root@vm134 pe]# glance image-download 9be94a27-367f-4a26-ae7a-045db3cb7332 --file myimg
iter() returned non-iterator of type 'NoneType'

Long Quan Sha (shalq)
Changed in glance:
assignee: nobody → Long Quan Sha (shalq)
Changed in glance:
status: New → In Progress
Long Quan Sha (shalq)
summary: - download error when the image locations is blank
+ download error when the image status is not active
Revision history for this message
Erno Kuvaja (jokke) wrote :

Thanks Long Quan Sha,

I added python-glanceclient into the bug and assigned that to you as that's where your patch is directed to, not glance.

I see two problems here, first you're correct and our client should be able to handle that situation, but foremost our server should not allow downloading image while it's still queued.

Changed in glance:
assignee: Long Quan Sha (shalq) → nobody
Changed in python-glanceclient:
assignee: nobody → Long Quan Sha (shalq)
Changed in glance:
status: In Progress → New
Changed in python-glanceclient:
status: New → In Progress
Changed in glance:
importance: Undecided → Medium
Changed in python-glanceclient:
importance: Undecided → Medium
Changed in glance:
assignee: nobody → dshakhray (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/228559

Changed in glance:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

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

commit d4d94b290ceb9147dd285822e201dd85ce812ef0
Author: Darja Shakhray <email address hidden>
Date: Mon Sep 28 21:10:05 2015 +0300

    Fix error when downloading image status is not active

    Added check image_status when downloading image.

    Change-Id: I39d49ea8a828863fdf4d5efc98126a9009e4b098
    Closes-bug: #1472449

Changed in glance:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/248704

Changed in glance:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-glanceclient (master)

Change abandoned by Long Quan Sha (<email address hidden>) on branch: master
Review: https://review.openstack.org/199549

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

Reviewed: https://review.openstack.org/199549
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=44d0b02c67ce7926f40377d9367a0f61124ed26d
Submitter: Jenkins
Branch: master

commit 44d0b02c67ce7926f40377d9367a0f61124ed26d
Author: Long Quan Sha <email address hidden>
Date: Wed Jul 8 09:29:53 2015 +0800

    Fix the download error when the image locations are blank

    When the image locations are blank, glance client will get a http response
    with no content, glance client should show user no data could be found,
    instead of processing the blank response body that will lead to exception.

    Glance client will also get a 204 response when an image is in a queued
    state (this is true for 'master' and liberty/kilo/juno based servers).

    Closes-Bug: #1472449

    Co-Authored-by: Stuart McLaren <email address hidden>
    Change-Id: I5d3d02d6aa7c8dd054cd2933e15b4a26e91afea1

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

Change abandoned by Glance Bot (<email address hidden>) on branch: master
Review: https://review.openstack.org/199378

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/python-glanceclient 2.0.0

This issue was fixed in the openstack/python-glanceclient 2.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (stable/liberty)

Reviewed: https://review.openstack.org/290499
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=c077858dd6e0cd827af2418e1a05ca1f27937764
Submitter: Jenkins
Branch: stable/liberty

commit c077858dd6e0cd827af2418e1a05ca1f27937764
Author: Long Quan Sha <email address hidden>
Date: Wed Jul 8 09:29:53 2015 +0800

    Fix the download error when the image locations are blank

    When the image locations are blank, glance client will get a http response
    with no content, glance client should show user no data could be found,
    instead of processing the blank response body that will lead to exception.

    Glance client will also get a 204 response when an image is in a queued
    state (this is true for 'master' and liberty/kilo/juno based servers).

    Closes-Bug: #1472449

    Co-Authored-by: Stuart McLaren <email address hidden>
    Change-Id: I5d3d02d6aa7c8dd054cd2933e15b4a26e91afea1
    (cherry picked from commit 44d0b02c67ce7926f40377d9367a0f61124ed26d)

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/python-glanceclient 1.1.1

This issue was fixed in the openstack/python-glanceclient 1.1.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on glance (stable/liberty)

Change abandoned by Matt Riedemann (<email address hidden>) on branch: stable/liberty
Review: https://review.openstack.org/248704

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-glanceclient 1.1.1

This issue was fixed in the openstack/python-glanceclient 1.1.1 release.

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.