Need to add url encode before give response to image show for v1

Bug #1471215 reported by Vadim Rovachev on 2015-07-03
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Undecided
Unassigned

Bug Description

If we use http proxy ip like a glance endpoint and add metadata for image in bug: https://bugs.launchpad.net/horizon/+bug/1449260
then http response have wrong HTTP type.

reproduced on branch: stable/juno

Steps to reproduce:
Precondition steps:
httpproxy glance endpoint: http://192.168.0.2:9292
host ip with runned glance-api: 192.168.0.6

Step 1. Create glance image, e.g.:
glance image-create --name test --id <uuid> --disk-format qcow2 --container-format bare --file <file>
response: http://paste.openstack.org/show/338516/

Step 2. Show glance image using v1 glance api and using curl:
glance --debug --os-image-api-version 1 image-show <uuid>
response: http://paste.openstack.org/show/338515/

curl -v -i -X HEAD -H 'X-Auth-Token: <keystone-token>' http://192.168.0.2:9292/v1/images/<uuid>
response: http://paste.openstack.org/show/338528/

Step 3. Add metadata like in bug: https://bugs.launchpad.net/horizon/+bug/1449260 using horizon or python v2 glance client. e.g.:
cat glance_add_meta.py: http://paste.openstack.org/show/338529/)
python glance_add_meta.py

Step 4. Repead step 2.

Expected result: GET 200 responce

Actual result Responses: 502 Bad Gateway:

curl -v -i -X HEAD -H 'X-Auth-Token: <keystone-token>' http://192.168.0.2:9292/v1/images/<uuid>
response: http://paste.openstack.org/show/338531/

glance --debug --os-image-api-version 1 image-show <uuid>
response: http://paste.openstack.org/show/338533/

------------------------------------------------------------------

If we use for CURl request host ip(bypass httpproxy glance endpoint) we have 200 OK.
curl -v -i -X HEAD -H 'X-Auth-Token: <keystone-token>' http://192.168.0.6:9292/v1/images/<uuid>
response: http://paste.openstack.org/show/338535/

If we use for CLI request os-image-url like a host ip (bypass httpproxy glance endpoint) we have 200 OK.
http://paste.openstack.org/show/338561/

description: updated
Erno Kuvaja (jokke) wrote :

Hi Vadim,

Thanks for reporting this bug. Could you please verify to me if this behavior is only with current stable/juno or if stable/kilo & master are affected also?

As Juno is on Support Phase II (https://wiki.openstack.org/wiki/StableBranch#Support_phases) I'm not fully convinced that this issue is critical enough to fix it there.

Do you know the mechanism for this issue to surface? is it the '<' and '>' characters in the headers or what is causing this specifically with the proxies? Also is this issue existing with one specific proxy or is it common with multiple ones? If you could specify the proxies tested, that would be helpful.

Changed in glance:
status: New → Incomplete
Mike Fedosin (mfedosin) wrote :

Erno, this is an issue in v1 api, where we transfer image metadata in headers. Glanceclient doesn't verify compliance with http, where '<' and '>' are forbidden, but HAproxy does. And it results as en error, if some property value contains these symbols.

In v2, where we transfer image metadata in body, it doesn't happen.

Glance does not support V1 and its has been removed since Ussuri.

Changed in glance:
status: Incomplete → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers