Bug 1049394 - Creating an image from CLI without --container format queued the image and fails with 400.
Summary: Creating an image from CLI without --container format queued the image and fa...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-glance
Version: 4.0
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: Upstream M3
: 6.0 (Juno)
Assignee: Jon Bernard
QA Contact: Dafna Ron
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-07 14:28 UTC by Eduardo Warszawski
Modified: 2016-04-26 13:34 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-01-27 08:46:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
create-image debug output (5.91 KB, text/plain)
2014-01-07 14:28 UTC, Eduardo Warszawski
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1268680 0 None None None Never
OpenStack gerrit 66386 0 None None None Never

Description Eduardo Warszawski 2014-01-07 14:28:26 UTC
Created attachment 846698 [details]
create-image debug output

Description of problem:

Creating an image from CLI without --container format queued the image and fails with 400.

Request returned failure status.
400 Bad Request
Invalid container format 'None' for image.
    (HTTP 400)

Version-Release number of selected component (if applicable):


How reproducible:
# glance --debug image-create --name rhel_65 --disk-format qcow2 --file /root/rhel-guest-image-6-6.5-20131115.0-1.qcow2 --progress

Actual results:
# glance --debug image-create --name rhel_65 --disk-format qcow2 --file /root/rhel-guest-image-6-6.5-20131115.0-1.qcow2 --progress
<snip. See attached file>
[=============================>] 100%

HTTP/1.1 400 Bad Request
date: Tue, 07 Jan 2014 14:13:54 GMT
content-length: 64
content-type: text/plain; charset=UTF-8
x-openstack-request-id: req-11b4ecad-3a8d-4e44-9c37-a4d843805889

400 Bad Request

Invalid container format 'None' for image.



# glance image-list
+--------------------------------------+---------+-------------+------------------+-----------+--------+
| ID                                   | Name    | Disk Format | Container Format | Size      | Status |
+--------------------------------------+---------+-------------+------------------+-----------+--------+
| b2490dd2-b535-4b98-8647-cca428a63e01 | rhel_65 | qcow2       |                  | 307962880 | queued |
| f1367012-3ca3-4bbc-954d-0a1a4352b928 | rhel_65 | qcow2       |                  | 307962880 | queued |
| 54e7bfa4-35a3-46c2-b604-23b3ef568482 | rhel_65 | qcow2       |                  | 307962880 | queued |
+--------------------------------------+---------+-------------+------------------+-----------+--------+

*** All these are failed images. ***

Expected results:
Should fail without queing anything.

Additional info:
Debug info is attach.

Comment 1 Flavio Percoco 2014-01-09 12:30:25 UTC
Looks like a bug indeed. A bit weird, though.

The image data deseralization / validation happens before the image creation.

  https://github.com/openstack/glance/blob/master/glance/api/v1/images.py#L1084

Comment 5 Jon Bernard 2014-01-10 21:34:10 UTC
The create method in Controller (not ImageDeserializer) is being called:

https://github.com/openstack/glance/blob/master/glance/api/v1/images.py#L726

The exception is raised as it should, but the image has already made it into the list/table at this point, even though create() raises an exception.

Comment 9 Jon Bernard 2014-06-02 20:45:48 UTC
I need to investigate the tempest test failures to determine if it's worth pursuing this further.  Pushing to 6.0 for now.

Comment 10 Jon Bernard 2014-10-15 15:22:37 UTC
Agreed in last week's meeting that this change could break backward compability in the v1 api and is not worth it at this point in v1's life cycle as v2 will hopefully become the default soon.

Comment 11 Flavio Percoco 2015-01-27 08:46:29 UTC
This is a v1 only issue, which won't land now that we're focusing just on v2. Closing.


Note You need to log in before you can comment on or make changes to this bug.