Glance v1: HTTP HEAD on /images/detail returns 500

Bug #1297358 reported by Alex Meade
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Arnaud Legendre

Bug Description

Attempting a HEAD request on the /images/detail resource results in a 500 response. This should ideally be an HTTP 405 response.

This issue does not occur when doing a HEAD on /images for some reason

curl -i -X HEAD -H "X-Auth-Token: $AUTH_TOKEN" -H 'Content-Type: application/json' -H 'User-Agent: python-glanceclient' http://localhost:9292/v1/images/detail
HTTP/1.1 500 Internal Server Error
Content-Type: text/plain
Content-Length: 0
Date: Tue, 25 Mar 2014 15:18:34 GMT
Connection: close

The traceback for the error can be found here:

Revision history for this message
Nikhil Komawar (nikhil-komawar) wrote :

We should probably add a Allow header to the response especially for a 405.

Please refer and

( )

Revision history for this message
wanghong (w-wanghong) wrote :

This is because the code mistakes that the "detail" is an image_id. Please refer: the line 44.

I think we should modify /opt/stack/glance/glance/registry/client/v1/", line 145, get_image to raise a 404 response.

Changed in glance:
assignee: nobody → Arnaud Legendre (arnaudleg)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master

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

Submitter: Jenkins
Branch: master

commit 8eb31484547b3cfc6c42e06e5d0124501b6339ef
Author: Arnaud Legendre <email address hidden>
Date: Fri Apr 4 18:29:44 2014 -0700

    Do not allow HEAD images/detail

    Currently, a HEAD images/detail request goes through the images/{id}
    route which leads to a 500 response status.
    This HEAD method should be handled separetely in order to return a
    405 Method Not Allowed response and suggest GET as an allowed method.

    Change-Id: Ic83e819189bcff7c4735af476217a9ed1e4f41b8
    Closes-Bug: #1297358

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