Image remains in queued status after location set via PATCH

Bug #1750892 reported by iain MacDonnell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
High
iain MacDonnell
Queens
In Progress
Undecided
iain MacDonnell
Rocky
In Progress
Undecided
iain MacDonnell

Bug Description

Pike release, with show_image_direct_url and show_multiple_locations enabled.

Attempting to create an image using the HTTP backend with the glance v2 API. I create a new/blank image (goes into "queued" status), then set the location with:

curl -g -i -X PATCH -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'User-Agent: imacdonn-getting-dangerous' -H 'X-Auth-Token: xxx' -H 'Content-Type: application/openstack-images-v2.1-json-patch' -d '[{"op":"replace", "path": "/locations", "value": [{"url": "http://my_http_server/cirros.img", "metadata": {}}]}]' http://my_glance_api_endpoint:9292/v2/images/e5581f14-2d05-4ae7-8d78-9da42731a37e

This results in the direct_url getting set correctly, and the size of the image is correctly determined, but the image remains in "queued" status. It should become "active".

Revision history for this message
Brian Rosmaita (brian-rosmaita) wrote :

Slightly off topic, but it's kind of overkill to have to expose locations in order to use the http store in this way. Maybe what we need is a 'web-reference' (instead of web-download) import method to do this.

Revision history for this message
iain MacDonnell (imacdonn) wrote :

Yes, please! I was considering opening a separate bug to request something like that...

Revision history for this message
Brian Rosmaita (brian-rosmaita) wrote :

Also note that the checksum is None and there's no way to set it in the v2 API.

Changed in glance:
status: New → Triaged
Erno Kuvaja (jokke)
Changed in glance:
importance: Undecided → High
Revision history for this message
Erno Kuvaja (jokke) wrote :

By the looks of it the replace call indeed does not touch the image state. Add call 'thjough will change the state from 'queued' to 'active'. You might want to try out "op":"add","path":"/locations/0"

Changed in glance:
assignee: nobody → iain MacDonnell (imacdonn)
assignee: iain MacDonnell (imacdonn) → nobody
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/592775
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=e2c54d58b33c7350c78629cc7726b5fa4509637b
Submitter: Zuul
Branch: master

commit e2c54d58b33c7350c78629cc7726b5fa4509637b
Author: imacdonn <email address hidden>
Date: Fri Aug 17 00:55:08 2018 +0000

    Update status to active when locations replaced

    Image status should be changed from 'queued' to 'active' when
    'locations' has been successfully replaced.

    Change-Id: I966688e67475e00a1eeb0cbe1632d5c811e41e4f
    Closes-Bug: 1750892

Changed in glance:
status: In Progress → Fix Released
Changed in glance:
milestone: none → stein-1
assignee: nobody → iain MacDonnell (imacdonn)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/598204

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/598253

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

Change abandoned by iain MacDonnell (<email address hidden>) on branch: stable/rocky
Review: https://review.openstack.org/598204
Reason: Project can't decide if this is the right thing to do or not, so dropping backports.

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

Change abandoned by iain MacDonnell (<email address hidden>) on branch: stable/queens
Review: https://review.openstack.org/598253
Reason: Project can't decide if this is the right thing to do or not, so dropping backports.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance 18.0.0.0b1

This issue was fixed in the openstack/glance 18.0.0.0b1 development milestone.

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.