Size of created image is 0 - no image data is sent

Bug #1666511 reported by Kamil Madac
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance Client
Invalid
Undecided
Unassigned

Bug Description

I'm trying to install OpenStack Newton from sources and I'm not able to successfully upload/create Cirros image:

openstack image create --container-format bare --disk-format qcow2 --file /app/cirros.img --public cirros

Everyting looks OK, except the fact that size of image is 0

+------------------+------------------------------------------------------+
| Field | Value |
+------------------+------------------------------------------------------+
| checksum | d41d8cd98f00b204e9800998ecf8427e |
| container_format | bare |
| created_at | 2017-02-21T12:35:31Z |
| disk_format | qcow2 |
| file | /v2/images/a6f65cc5-e41b-480d-97bb-0fb1c9d69564/file |
| id | 0419ce1b-2165-48e5-a37e-c39436babddd |
| min_disk | 0 |
| min_ram | 0 |
| name | cirros3 |
| owner | 457615afdf684796aef380f6de2f2cb4 |
| protected | False |
| schema | /v2/schemas/image |
| size | 0 |
| status | active |
| tags | |
| updated_at | 2017-02-21T12:35:32Z |
| virtual_size | None |
| visibility | public |
+------------------+------------------------------------------------------+

When I look into glance filesystem, the file size is 0:

ls -la 0419ce1b-2165-48e5-a37e-c39436babddd
-rw-r----- 1 root root 0 Feb 21 08:59 0419ce1b-2165-48e5-a37e-c39436babddd

Version of pakcages:
python-glanceclient (2.6.0)
requests (2.13.0)

Revision history for this message
Kamil Madac (kamil-madac) wrote :

I found out that chunking doesn't work for some reason. I fixed the problem by patching /usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py

--- a/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py
+++ b/usr/local/lib/python2.7/dist-packages/glanceclient/common/http_new.py
@@ -84,7 +84,7 @@ class _BaseHTTPClient(object):
                 # Here we assume it's
                 # a file-like object
                 # and we'll chunk it
- data = self._chunk_body(data)
+ pass

         headers['Content-Type'] = content_type
         kwargs['stream'] = content_type == 'application/octet-stream'

Revision history for this message
Kamil Madac (kamil-madac) wrote :

After further investigation, root cause of a problem is WebOB 1.7.0 incompatibility with Glance in Newton. Bug is reported here - https://bugs.launchpad.net/glance/+bug/1657459.

More description and discussion about incompatibility can be found here - https://github.com/Pylons/webob/issues/307

After downgrade of WebOB to 1.6.0 on Glance side I can successfully upload new image.

Changed in python-glanceclient:
status: New → 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.