glance sets image size to 0 for http images -> yields connection reset error on GET
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Fix Released
|
Medium
|
Brian Waldon |
Bug Description
Adding an image via
glance --verbose add name="openSUSE 11.4 JeOS" disk_format=raw container_
will yield output like this:
Added new image with ID: 9
Returned the following metadata for the new image:
Completed in 0.1457 sec.
Not the size of 0! With size set to 0, you won't be able to retrieve the image using http://
This is due to glance/server.py
def show(self, req, id):
,,,
res = Response(
# Using app_iter blanks content-length, so we set it here...
which will set Content-Length to 0. Uncommenting this line, will get this to work!
Changed in glance: | |
milestone: | diablo-2 → diablo-3 |
Changed in glance: | |
milestone: | diablo-3 → diablo-4 |
Changed in glance: | |
assignee: | Jay Pipes (jaypipes) → nobody |
Changed in glance: | |
milestone: | diablo-4 → diablo-rbp |
Changed in glance: | |
milestone: | diablo-rbp → 2011.3 |
Changed in glance: | |
assignee: | nobody → Brian Waldon (bcwaldon) |
Changed in glance: | |
status: | Confirmed → In Progress |
Changed in glance: | |
status: | Fix Committed → Fix Released |
http:// glance. openstack. org/glanceapi. html#adding- image-metadata- in-http- headers states:
----
* x-image-meta-size
This header is optional.
When present, Glance assumes that the expected size of the request body will be the value of this header. If the length in bytes of the request body does not match the value of this header, Glance will return a 400 Bad Request.
When not present, Glance will calculate the image’s size based on the size of the request body.
----
Glance would at least need to set the size based on a HEAD-request to the location that is being added.