Bug 974119 - Glance fails with an error while trying to create an image which does not contain content-length
Glance fails with an error while trying to create an image which does not con...
Status: CLOSED ERRATA
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-glance (Show other bugs)
3.0
Unspecified Linux
unspecified Severity high
: rc
: 4.0
Assigned To: Jon Bernard
Yogev Rabl
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-13 09:05 EDT by Nir Magnezi
Modified: 2016-04-26 21:55 EDT (History)
5 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-19 19:06:06 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Launchpad 1201331 None None None Never

  None (edit)
Description Nir Magnezi 2013-06-13 09:05:40 EDT
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 17:42:25 EST
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 17:45:26 EST
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 18:10:38 EST
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 05:09:49 EST
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 13:51:15 EST
I updated the doc text, let me know if you need anything else.
Comment 11 errata-xmlrpc 2013-12-19 19:06:06 EST
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.