/v1.1 returns a 500 error

Bug #1166957 reported by James Li
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Undecided
James Li

Bug Description

Glance version Grizzly-rc1

curl -k -i -X GET https://localhost:9292/v1.1

HTTP/1.1 500 Internal Server Error
Content-Type: text/plain
Content-Length: 0
Date: Tue, 09 Apr 2013 18:38:46 GMT
Connection: close

curl -k -i -X GET https://localhost:9292/v1.1/

HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Content-Length: 204
Date: Tue, 09 Apr 2013 18:47:16 GMT

{"images": [...]}

Revision history for this message
James Li (james-li-3) wrote :

A similar problem was reported in Nova:

https://bugs.launchpad.net/nova/+bug/865585

But after applying the patch, it seems not work perfectly for Glance, the following is the output of the functional test:

request: '/v1.1'

response:
{'status': '302', 'content-length': '0', 'location': 'http://127.0.0.1:40738/v1.1/v1/', 'date': 'Tue, 09 Apr 2013 18:42:25 GMT', 'content-type': 'text/plain; charset=utf8', 'x-openstack-request-id': 'req-54153ed3-db43-4323-82d0-5e96b8f1d0cb'}

I got a duplicate version string as '/v1.1/v1/'. Working on a patch for that now.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.openstack.org/26812

Changed in glance:
assignee: nobody → James Li (james-li-3)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/26812
Committed: http://github.com/openstack/glance/commit/39477afb0e8f6060c44975fe6a67393a506a9dbe
Submitter: Jenkins
Branch: master

commit 39477afb0e8f6060c44975fe6a67393a506a9dbe
Author: James Li <email address hidden>
Date: Fri Apr 12 02:01:18 2013 +0000

    Redirects requests from /v# to /v#/

    Added an APIMapper to catch routemaps when the url is ''
    because routes.Mapper returns an error if this is the case
    but we want a redirect

    Refer to the Nova code at:
    https://review.openstack.org/#/c/886/

    Change-Id: I74011d14a02a3bc8767fab559ada4c2d82dc5d6e
    Fixes: bug #1166957

Changed in glance:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.openstack.org/28217

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/28217
Committed: http://github.com/openstack/glance/commit/abbc5353336001572290feb8d06d65094b83a7cf
Submitter: Jenkins
Branch: master

commit abbc5353336001572290feb8d06d65094b83a7cf
Author: James Li <email address hidden>
Date: Fri May 3 22:31:58 2013 +0000

    Redirects requests from /v# to /v#/ with correct Location header

    This is a continuous fix to bug #1166957

    VersionNegotiationFilter pops off the version string of PATH_INFO,
    the popped segment is pushed onto SCRIPT_NAME, which results in
    dual version strings (e.g. '/v1/v1/') in the 'Location' header
    of a redirect response. This may result in a further 404 error
    if the http client will automatically follow the returned
    redirect.

    Fix this problem by adding a private method which does not
    push the popped segment onto SCRIPT_NAME.

    Change-Id: Ie0c244af38534dde2058828fbff840a845cc7c90
    Fixes: bug #1175815

Thierry Carrez (ttx)
Changed in glance:
milestone: none → havana-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: havana-1 → 2013.2
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.