glance --location images handling is hiding HTTP errors and uses incorrect HTTP codes...
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Fix Released
|
Medium
|
Rajesh Tailor | ||
glance_store |
Fix Released
|
Medium
|
Rajesh Tailor |
Bug Description
1) Glance is hiding error messages when used with --location. If the URL returns HTTP 404, glance is just ignoring it.
2) Reply to GET request to http://
location: http://
which is referring the same URL. This feels weird.
3) It also replies with HTTP 200 in the case above, so why does the reply contain the "location" header?
How can it reply 200 when it couldn't have succeed to download the image?
[root@cloudimg ~(keystone_admin)]# glance image-create --location http://
/usr/lib64/
_warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWar
+------
| Property | Value |
+------
| checksum | None |
| container_format | bare |
| created_at | 2014-05-05T12:42:17 |
| deleted | False |
| deleted_at | None |
| disk_format | qcow2 |
| id | 2e34a168-
| is_public | False |
| min_disk | 0 |
| min_ram | 0 |
| name | 404.html |
| owner | 56be9abf0ca2419
| protected | False |
| size | 0 |
| status | active |
| updated_at | 2014-05-05T12:42:17 |
+------
exit code: 0
[root@cloudimg ~(keystone_admin)]# glance --debug image-download --file 404.html 404.html; echo "exit code: $?"
/usr/lib64/
_warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWar
curl -i -X GET -H 'X-Auth-Token: MIIO3wYJKoZIhvc
HTTP/1.1 200 OK
date: Mon, 05 May 2014 12:44:06 GMT
content-length: 425
content-type: application/json; charset=UTF-8
x-openstack-
{"images": [{"status": "active", "name": "404.html", "deleted": false, "container_format": "bare", "created_at": "2014-05-
curl -i -X GET -H 'X-Auth-Token: MIIO3wYJKoZIhvc
HTTP/1.1 200 OK
content-length: 0
x-image-meta-id: 2e34a168-
date: Mon, 05 May 2014 12:44:07 GMT
x-image-
x-image-
x-image-
x-image-
x-image-
x-image-meta-size: 0
x-image-
location: http://
x-image-
x-image-
x-image-meta-owner: 56be9abf0ca2419
x-image-
content-type: application/
x-openstack-
x-image-
x-image-meta-name: 404.html
exit code: 0
[root@cloudimg ~(keystone_admin)]# hexdump 404.html -C
[root@cloudimg ~(keystone_admin)]#
[root@cloudimg ~(keystone_admin)]# du 404.html
0 404.html
Note there is no ERROR nor WARNING in the log. I am quite OK with that, but the end user should be notified with ERRORs when the glance image-download fails.
Changed in glance: | |
assignee: | nobody → Rajesh Tailor (rajesh-tailor) |
Changed in glance-store: | |
assignee: | nobody → Rajesh Tailor (rajesh-tailor) |
Changed in glance-store: | |
status: | New → Fix Committed |
Changed in glance: | |
milestone: | none → kilo-2 |
Changed in glance: | |
importance: | Undecided → Medium |
Changed in glance: | |
milestone: | kilo-2 → kilo-3 |
Changed in glance-store: | |
importance: | Undecided → Medium |
milestone: | none → v0.1.12 |
milestone: | v0.1.12 → none |
status: | Fix Committed → Fix Released |
Changed in glance: | |
status: | Fix Committed → Fix Released |
Changed in glance: | |
milestone: | kilo-3 → 2015.1.0 |
rpm -q openstack-glance glance- 2013.2. 3-1.el6ost. noarch
openstack-