Comment 0 for bug 1372564

Revision history for this message
Mike Fedosin (mfedosin) wrote :

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.