[swift driver] BufferedReader uploading 0 bytes instead of actual supplied data

Bug #1819022 reported by Brian Rosmaita
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glance_store
Triaged
High
Unassigned

Bug Description

This was observed on a recent (Stein) glance running in a container on RHEL 8.

config extract:
$ 'grep -v ^# /etc/glance/glance-api.conf | grep -e swift'
stores=http,swift
default_store=swift
swift_store_endpoint_type=internalURL
swift_store_create_container_on_put=True
swift_buffer_on_upload = true
swift_upload_buffer_dir = /var/lib/glance
default_swift_reference=ref1
swift_store_config_file=/etc/glance/glance-swift.conf

the file:
$ ls -l overcloud-full.qcow2
-rw-r--r--. 1 stack stack 950599680 Mar 1 13:21 overcloud-full.qcow2

the result:
$ glance image-show 8295d200-0903-48b6-97b8-30b6566a91ee
+------------------+----------------------------------------------------------------------------------+
| Property | Value |
+------------------+----------------------------------------------------------------------------------+
| checksum | d41d8cd98f00b204e9800998ecf8427e |
| container_format | bare |
| created_at | 2019-03-07T06:38:09Z |
| direct_url | swift+config://ref1/glance/8295d200-0903-48b6-97b8-30b6566a91ee |
| disk_format | qcow2 |
| hw_architecture | x86_64 |
| id | 8295d200-0903-48b6-97b8-30b6566a91ee |
| kernel_id | bf673768-3fe1-4ee4-8e76-09f9f0fd7e31 |
| min_disk | 0 |
| min_ram | 0 |
| name | overcloud-full |
| os_hash_algo | sha512 |
| os_hash_value | cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0 |
| | ff8318d2877eec2f63b931bd47417a81a538327af927da3e |
| os_hidden | False |
| owner | b837697327f841bc8aebade4a8bd8ba8 |
| protected | False |
| ramdisk_id | 52f3474b-ad53-4e3a-9413-a10369b0ab13 |
| size | 0 |
| status | active |
| tags | [] |
| updated_at | 2019-03-07T06:38:11Z |
| virtual_size | Not available |
| visibility | public |
+------------------+----------------------------------------------------------------------------------+
checksum and os_hash_value match those of an empty file:
$ touch it
$ md5sum it
d41d8cd98f00b204e9800998ecf8427e it
$ sha512sum it
cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e it

log extract:
2019-03-07 01:38:09.792 24 DEBUG glance_store._drivers.swift.store [req-6bd1a2b0-7e04-4773-9213-d1e7fdd375aa 6b6207ebfc464dd1b161979078bd97da b837697327f841bc8aebade4a8bd8ba8 - default default] Adding image object '8295d200-0903-48b6-97b8-30b6566a91ee' to Swift add /usr/lib/python3.6/site-packages/glance_store/_drivers/swift/store.py:941
2019-03-07 01:38:09.792 24 DEBUG glance_store._drivers.swift.store [req-6bd1a2b0-7e04-4773-9213-d1e7fdd375aa 6b6207ebfc464dd1b161979078bd97da b837697327f841bc8aebade4a8bd8ba8 - default default] Cannot determine image size because it is either not provided in the request or chunked-transfer encoding is used. Adding image as a segmented object to Swift. add /usr/lib/python3.6/site-packages/glance_store/_drivers/swift/store.py:964
2019-03-07 01:38:09.793 24 DEBUG glance_store._drivers.swift.buffered [req-6bd1a2b0-7e04-4773-9213-d1e7fdd375aa 6b6207ebfc464dd1b161979078bd97da b837697327f841bc8aebade4a8bd8ba8 - default default] Buffering 204800000 bytes of image segment _buffer /usr/lib/python3.6/site-packages/glance_store/_drivers/swift/buffered.py:139
2019-03-07 01:38:10.321 24 DEBUG glance_store._drivers.swift.store [req-6bd1a2b0-7e04-4773-9213-d1e7fdd375aa 6b6207ebfc464dd1b161979078bd97da b837697327f841bc8aebade4a8bd8ba8 - default default] Not writing zero-length chunk. add /usr/lib/python3.6/site-packages/glance_store/_drivers/swift/store.py:993
2019-03-07 01:38:10.353 24 DEBUG swiftclient [req-6bd1a2b0-7e04-4773-9213-d1e7fdd375aa 6b6207ebfc464dd1b161979078bd97da b837697327f841bc8aebade4a8bd8ba8 - default default] REQ: curl -i http://192.168.24.1:8080/v1/AUTH_82f2841e2ee942359031b62754a033ec/glance/8295d200-0903-48b6-97b8-30b6566a91ee -X PUT -H "ETag: d41d8cd98f00b204e9800998ecf8427e" -H "X-Object-Manifest: glance/8295d200-0903-48b6-97b8-30b6566a91ee-" -H "X-Auth-Token: gAAAAABcgLxRR4MG..." -H "Content-Length: 0" http_log /usr/lib/python3.6/site-packages/swiftclient/client.py:167
2019-03-07 01:38:10.353 24 DEBUG swiftclient [req-6bd1a2b0-7e04-4773-9213-d1e7fdd375aa 6b6207ebfc464dd1b161979078bd97da b837697327f841bc8aebade4a8bd8ba8 - default default] RESP STATUS: 201 Created http_log /usr/lib/python3.6/site-packages/swiftclient/client.py:168
2019-03-07 01:38:10.353 24 DEBUG swiftclient [req-6bd1a2b0-7e04-4773-9213-d1e7fdd375aa 6b6207ebfc464dd1b161979078bd97da b837697327f841bc8aebade4a8bd8ba8 - default default] RESP HEADERS: {'Last-Modified': 'Thu, 07 Mar 2019 06:38:11 GMT', 'Content-Length': '0', 'Etag': 'd41d8cd98f00b204e9800998ecf8427e', 'Content-Type': 'text/html; charset=UTF-8', 'X-Trans-Id': 'tx01a1fc4fb34a421c83bf5-005c80bc52', 'X-Openstack-Request-Id': 'tx01a1fc4fb34a421c83bf5-005c80bc52', 'Date': 'Thu, 07 Mar 2019 06:38:10 GMT'} http_log /usr/lib/python3.6/site-packages/swiftclient/client.py:169

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.