Bug 974119 - Glance fails with an error while trying to create an image which does not contain content-length
Summary: Glance fails with an error while trying to create an image which does not con...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-glance
Version: 3.0
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: rc
: 4.0
Assignee: Jon Bernard
QA Contact: Yogev Rabl
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-13 13:05 UTC by Nir Magnezi
Modified: 2016-04-27 01:55 UTC (History)
5 users (show)

Fixed In Version: openstack-glance-2013.2-3.el6ost
Doc Type: Bug Fix
Doc Text:
Images created from a URL to a compressed image were missing a 'Content-Length' entry in the HTTP header block. Consequently, Image Service image creation failed with a size mismatch error. With this update, images can now be created from a compressed image URL.
Clone Of:
Environment:
Last Closed: 2013-12-20 00:06:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1201331 0 None None None Never
Red Hat Product Errata RHEA-2013:1859 0 normal SHIPPED_LIVE Red Hat Enterprise Linux OpenStack Platform Enhancement Advisory 2013-12-21 00:01:48 UTC

Description Nir Magnezi 2013-06-13 13:05:40 UTC
Description of problem:
=======================
It seems to be HTTP's store back-end fault. 
Images coming from Berrange's Fedora people account are gzip and without content-length which seems not to be supported by the HTTP Store[0]. 
The output of HEAD requests:

This one doesn't work:
$ http HEAD  http://berrange.fedorapeople.org/images/2012-11-15/f17-x86_64-openstack-sda.qcow2
HTTP/1.1 200 OK
Accept-Ranges: bytes
Connection: close
Content-Encoding: gzip
Content-Type: text/plain; charset=UTF-8
Date: Thu, 13 Jun 2013 09:52:58 GMT
ETag: "f050000-4ce9a8e6356c3"
Last-Modified: Fri, 16 Nov 2012 10:51:56 GMT
Server: Apache/2.2.15
Vary: Accept-Encoding,User-Agent

This one works:
$ http HEAD  http://<URL>/rhel-server-x86_64-kvm-6.4_20130130.0-2-sda.qcow2                                  
HTTP/1.1 200 OK
Accept-Ranges: bytes
Connection: close
Content-Length: 1974140928
Content-Type: text/plain; charset=UTF-8
Date: Thu, 13 Jun 2013 09:53:48 GMT
ETag: "3dfbc9b-75ab0000-4d5c49badaf40"
Last-Modified: Fri, 15 Feb 2013 14:58:29 GMT
Server: Apache

[0] https://github.com/openstack/glance/blob/stable/grizzly/glance/store/http.py#L126

Version-Release number of selected component (if applicable):
=============================================================
openstack-glance-2013.1-3.el6ost.noarch

How reproducible:
=================
3/3

Steps to Reproduce:
===================
Load an image to glance as follows:
 # glance image-create --name test --disk-format qcow2  --container-format bare --copy-from http://berrange.fedorapeople.org/images/2012-11-15/f17-x86_64-openstack-sda.qcow2 --is-public true

Actual results:
===============
1. Image not loaded to glance and failed with the following error:
api.log:2013-06-13 11:39:32.581 13504 ERROR glance.api.v1.images [-] Supplied size (251985920) and size generated from uploaded image (132292056) did not match. Setting image status to 'killed'. 

Expected results:
=================
The image should be loaded with no errors.

Comment 3 Jon Bernard 2013-11-22 22:42:25 UTC
I have tested this in both latest git using devstack and in the official havana release and the command executes succesfully on both.  I belive it is no longer a bug.

Comment 4 Jon Bernard 2013-11-22 22:45:26 UTC
I moved it to MODIFIED since the fix is part of havana, but I think it should be retested by QE just to be safe.

Comment 5 Jon Bernard 2013-11-22 23:10:38 UTC
Here is my console output for the test:

~ $ glance image-list
+--------------------------------------+---------------------------------+-------------+------------------+----------+--------+
| ID                                   | Name                            | Disk Format | Container Format | Size     | Status |
+--------------------------------------+---------------------------------+-------------+------------------+----------+--------+
| a8d4db77-1812-4514-9302-9a89df0bf0d7 | cirros-0.3.1-x86_64-uec         | ami         | ami              | 25165824 | active |
| d356d5f9-08f2-4576-b2e6-472d1f471a61 | cirros-0.3.1-x86_64-uec-kernel  | aki         | aki              | 4955792  | active |
| 3e964d3f-2556-4580-bb96-a159bf676ad3 | cirros-0.3.1-x86_64-uec-ramdisk | ari         | ari              | 3714968  | active |
+--------------------------------------+---------------------------------+-------------+------------------+----------+--------+
~ $ glance image-create --name test --disk-format qcow2 --container-format bare --copy-from http://berrange.fedorapeople.org/images/2012-11-15/f17-x86_64-openstack-sda.qcow2 --is-public true
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | None                                 |
| container_format | bare                                 |
| created_at       | 2013-11-22T23:06:47                  |
| deleted          | False                                |
| deleted_at       | None                                 |
| disk_format      | qcow2                                |
| id               | 11212204-70e8-4e10-9ff6-3b594e9ace67 |
| is_public        | True                                 |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | test                                 |
| owner            | 606ea027e1de4277a20b17ce5b247f4d     |
| protected        | False                                |
| size             | 251985920                            |
| status           | queued                               |
| updated_at       | 2013-11-22T23:06:47                  |
+------------------+--------------------------------------+
~ $ glance image-list
+--------------------------------------+---------------------------------+-------------+------------------+-----------+--------+
| ID                                   | Name                            | Disk Format | Container Format | Size      | Status |
+--------------------------------------+---------------------------------+-------------+------------------+-----------+--------+
| a8d4db77-1812-4514-9302-9a89df0bf0d7 | cirros-0.3.1-x86_64-uec         | ami         | ami              | 25165824  | active |
| d356d5f9-08f2-4576-b2e6-472d1f471a61 | cirros-0.3.1-x86_64-uec-kernel  | aki         | aki              | 4955792   | active |
| 3e964d3f-2556-4580-bb96-a159bf676ad3 | cirros-0.3.1-x86_64-uec-ramdisk | ari         | ari              | 3714968   | active |
| 11212204-70e8-4e10-9ff6-3b594e9ace67 | test                            | qcow2       | bare             | 251985920 | saving |
+--------------------------------------+---------------------------------+-------------+------------------+-----------+--------+

Comment 7 Yogev Rabl 2013-12-04 10:09:49 UTC
verified the bug on:

python-glanceclient-0.10.0-1.el6ost.noarch
python-glance-2013.2-3.el6ost.noarch
openstack-glance-2013.2-3.el6ost.noarch

Comment 9 Jon Bernard 2013-12-12 18:51:15 UTC
I updated the doc text, let me know if you need anything else.

Comment 11 errata-xmlrpc 2013-12-20 00:06:06 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2013-1859.html


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