Image corrupts when upload
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
In Progress
|
High
|
Unassigned | ||
Liberty |
New
|
High
|
Unassigned |
Bug Description
After this commit https:/
image uploads works incorrect.
Steps to reproduce:
1. Upload image (1.47GB)
md5sum virtual_
fa9ec35d64d43ae
glance image-create --disk-format raw --container-format bare --file virtual_
[======
+------
| Property | Value |
+------
| checksum | fa9ec35d64d43ae
| container_format | bare |
| created_at | 2016-01-
| disk_format | raw |
| id | 5b955bce-
| min_disk | 0 |
| min_ram | 0 |
| name | ubuntu_
| owner | e885a6c5e87c45d
| protected | False |
| size | 1476395008 |
| status | active |
| tags | [] |
| updated_at | 2016-01-
| virtual_size | None |
| visibility | private |
+------
2. It has 10 obects in Swift, but should has only one (size is less than 5G)
swift list glance
5b955bce-
5b955bce-
5b955bce-
5b955bce-
5b955bce-
5b955bce-
5b955bce-
5b955bce-
5b955bce-
5b955bce-
Image splitted by 7 chunks of 200MB + 1*47MB + 1 zero length chunk.
swift stat glance 5b955bce-
Account: v1
Container: glance
Object: 5b955bce-
Content Type: binary/octet-stream
Content Length: 204800000
Last Modified: Mon, 25 Jan 2016 11:10:42 GMT
ETag: eda9a9889837ac4
Accept-Ranges: bytes
Server: Apache
X-Timestamp: 1453720242.00000
X-Trans-Id: tx0000000000000
swift stat glance 5b955bce-
Account: v1
Container: glance
Object: 5b955bce-
Content Type: binary/octet-stream
Content Length: 42795008
Last Modified: Mon, 25 Jan 2016 11:10:49 GMT
ETag: f3c9b36eceea8d2
Accept-Ranges: bytes
Server: Apache
X-Timestamp: 1453720249.00000
X-Trans-Id: tx0000000000000
swift stat glance 5b955bce-
Account: v1
Container: glance
Object: 5b955bce-
Content Type: binary/octet-stream
Content Length: 0
Last Modified: Mon, 25 Jan 2016 11:10:49 GMT
ETag: d41d8cd98f00b20
Accept-Ranges: bytes
Server: Apache
X-Timestamp: 1453720249.00000
X-Trans-Id: tx0000000000000
3. Download image
glance image-download 5b955bce-
[======
Image is corrupted, and original and result files has difference in lenght (1754 bytes)
ls -l virtual_
-rw-r--r-- 1 root root 1476395008 Jan 25 11:04 virtual_
ls -l ubuntu_
-rw-r--r-- 1 root root 1476393254 Jan 25 11:17 ubuntu_
Changed in glance: | |
assignee: | nobody → Kairat Kushaev (kkushaev) |
Changed in glance: | |
status: | New → Incomplete |
status: | Incomplete → Confirmed |
Changed in glance: | |
importance: | Undecided → High |
> It has 10 obects in Swift, but should has only one (size is less than 5G)
The v2 client doesn't seem to send the size to the server at all:
PUT /v2/images/ 36e7def9- f734-4e09- 9feb-872e58648a 01/file HTTP/1.1. glanceclient. octet-stream.
Host: 10.0.0.100:9292.
Accept-Encoding: gzip, deflate.
Transfer-Encoding: chunked.
Accept: */*.
X-Auth-Token: xxx
Connection: keep-alive.
User-Agent: python-
Content-Type: application/
so the server, not having anyway to know the amount of bytes it's going to receive will segment the upload.
(This may be a client bug.)
I haven't been able to reproduce this on devstack (so far):
$ glance image-create --file /tmp/dd.1476395008 --name bug1537721 --container-format bare --disk-format raw ------- ------+ ------- ------- ------- ------- ------- ---+ ------- ------+ ------- ------- ------- ------- ------- ---+ 89c5bbc6c5bd1a3 05 | 25T12:29: 03Z | 1b78-462b- 93a0-dbf3a66d26 b2 | 7a96fe367c15c34 7b | 25T12:29: 23Z | ------- ------+ ------- ------- ------- ------- ------- ---+
+-----
| Property | Value |
+-----
| checksum | a9db0ed9b9e4670
| container_format | bare |
| created_at | 2016-01-
| disk_format | raw |
| id | 94a15b66-
| min_disk | 0 |
| min_ram | 0 |
| name | bug1537721 |
| owner | a03febe48109492
| protected | False |
| size | 1476395008 |
| status | active |
| tags | [] |
| updated_at | 2016-01-
| virtual_size | None |
| visibility | private |
+-----
$ glance image-download 94a15b66- 1b78-462b- 93a0-dbf3a66d26 b2 --file /tmp/download. 1476395008
$ md5sum /tmp/download. 1476395008 089c5bbc6c5bd1a 305 /tmp/download. 1476395008
a9db0ed9b9e467
94a15b66- 1b78-462b- 93a0-dbf3a66d26 b2
Account: AUTH_30514a9dd1 1f4ed3970e46bfe b0b47ee 1b78-462b- 93a0-dbf3a66d26 b2 octet-stream aa9aa658f991cdc 108" 94a15b66- 1b78-462b- 93a0-dbf3a66d26 b2- 4c988ebd- 0056a6169c
Container: glance
Object: 94a15b66-
Content Type: application/
Content Length: 1476395008
Last Modified: Mon, 25 Jan 2016 12:29:24 GMT
ETag: "c5c28ea692acc7
Manifest: glance/
Accept-Ranges: bytes
X-Timestamp: 1453724963.57836
X-Trans-Id: tx9e7e24de2cc34
94a15b66- 1b78-462b- 93a0-dbf3a66d26 b2-00001
Account: AUTH_30514a9dd1 1f4ed3970e46bfe b0b47ee 1b78-462b- 93a0-dbf3a66d26 b2-00001 octet-stream bc81d6387d92c1b ec 05fabb5d- 0056a6169d
Container: glance
Object: 94a15b66-
Content Type: application/
Content Length: 204800000
Last Modified: Mon, 25 Jan 2016 12:29:04 GMT
ETag: eda9a9889837ac4
Accept-Ranges: bytes
X-Timestamp: 1453724943.43825
X-Trans-Id: txd8aa4dc200bc4
94a15b66- 1b78-462b- 93a0-dbf3a66d26 b2-00002
Account: AUTH_30514a9dd1 1f4ed3970e46bfe ...