Incorrect status change after image uploading in v2

Bug #1372564 reported by Mike Fedosin
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance
In Progress
High
Darja Shakhray
Juno
Fix Released
High
Unassigned
Kilo
Fix Released
High
Unassigned

Bug Description

If the image is deleted (i.e. its status changed to 'deleted' in db) when it's uploading through image-upload command in v2, its status surprisingly switches from 'deleted' to 'active' without any exception.
There is the code that should handle NotFound exception in that case
https://github.com/openstack/glance/blob/master/glance/api/v2/image_data.py :77

except exception.NotFound as e:
msg = (_("Image %(id)s could not be found after upload."
"The image may have been deleted during the upload: "
"%(error)s Cleaning up the chunks uploaded") %
{'id': image_id,
'error': utils.exception_to_str(e)})

but it never executes because the exception is not raised.
In v1 this problem is solved with explicitly passing from_state argument, but in v2 it's not possible.

Louis Taylor (kragniz)
Changed in glance:
status: New → Confirmed
Mike Fedosin (mfedosin)
description: updated
Mike Fedosin (mfedosin)
Changed in glance:
assignee: nobody → Mike Fedosin (mfedosin)
Changed in glance:
importance: Undecided → High
tags: added: juno-rc1-potential
Changed in glance:
status: Confirmed → In Progress
Dolph Mathews (dolph)
tags: added: juno-rc-potential
removed: juno-rc1-potential
Revision history for this message
Nikhil Komawar (nikhil-komawar) wrote :
Thierry Carrez (ttx)
tags: added: juno-backport-potential
removed: juno-rc-potential
Mike Fedosin (mfedosin)
tags: added: kilo-1
Changed in glance:
milestone: none → kilo-2
Ian Cordasco (icordasc)
tags: removed: kilo-1
Thierry Carrez (ttx)
Changed in glance:
milestone: kilo-2 → kilo-3
Thierry Carrez (ttx)
Changed in glance:
milestone: kilo-3 → kilo-rc1
tags: added: kilo-rc-potential
Changed in glance:
milestone: kilo-rc1 → none
Thierry Carrez (ttx)
tags: removed: kilo-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on glance (master)

Change abandoned by Mike Fedosin (<email address hidden>) on branch: master
Review: https://review.openstack.org/123799
Reason: See my last comment

Revision history for this message
Flavio Percoco (flaper87) wrote :

Apparently this was fixed by: https://review.openstack.org/#/c/144464/

Changed in glance:
status: In Progress → Fix Committed
assignee: Mike Fedosin (mfedosin) → nobody
status: Fix Committed → Fix Released
status: Fix Released → Invalid
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Changed in glance:
assignee: nobody → Darja Shakhray (dshakhray)
Changed in glance:
status: Invalid → In Progress
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.