Glance fails with an error while trying to create an image which does not contain content-length (using copy-from)

Bug #1201331 reported by Flavio Percoco
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Invalid
Medium
Jon Bernard

Bug Description

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

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.

Changed in glance:
importance: Undecided → Medium
status: New → Triaged
David Cesiel (dcesiel)
Changed in glance:
assignee: nobody → David Cesiel (dcesiel)
Revision history for this message
Flavio Percoco (flaper87) wrote :

@david, you working on this?

David Cesiel (dcesiel)
Changed in glance:
assignee: David Cesiel (dcesiel) → nobody
Changed in glance:
assignee: nobody → Flavio Percoco (flaper87)
Jon Bernard (jbernard)
Changed in glance:
assignee: Flavio Percoco (flaper87) → Jon Bernard (jbernard)
Revision history for this message
Jon Bernard (jbernard) wrote :

This just worked without error for me in devstack. I will re-test in havana and grizzly

Revision history for this message
Jon Bernard (jbernard) wrote :
Download full text (3.5 KiB)

I tested this on both lastest git using devstack and the current havana tag and the command executes succesfully. So I don't think this is an issue anymore. Console output:

~ $ 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 | cirr...

Read more...

Changed in glance:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.