Request-id is not getting returned if glance throws 500 error

Bug #1480196 reported by Abhijeet Malawade
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
High
Abhijeet Malawade
Kilo
Fix Released
High
Unassigned

Bug Description

If glance throws Internal Server Error (500) for some reason,
then in that case 'request-id' is not getting returned in response headers.

Request-id is required to analyse logs effectively on failure and it should be
returned from headers.

For ex. -

image-create api returns 500 error if property name exceeds 255 characters
(fix for this issue is in progress : https://review.openstack.org/#/c/203948/)

curl command:

$ curl -g -i -X POST -H 'Accept-Encoding: gzip, deflate' -H 'x-image-meta-container_format: ami' -H 'x-image-meta-property-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: jskg' -H 'Accept: */*' -H 'X-Auth-Token: b94bd7b3a0fb4fada73fe170fe7d49cb' -H 'Connection: keep-alive' -H 'x-image-meta-is_public: None' -H 'User-Agent: python-glanceclient' -H 'Content-Type: application/octet-stream' -H 'x-image-meta-disk_format: ami' http://10.69.4.173:9292/v1/images

HTTP/1.1 500 Internal Server Error
Content-Type: text/plain
Content-Length: 0
Date: Fri, 31 Jul 2015 08:27:31 GMT
Connection: close

Here request-id is not part of response header.

Changed in glance:
assignee: nobody → Abhijeet Malawade (abhijeet-malawade)
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/207847

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

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

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

Reviewed: https://review.openstack.org/211447
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=f660846f7ad5da350f1eec9622538cba4ab25827
Submitter: Jenkins
Branch: master

commit f660846f7ad5da350f1eec9622538cba4ab25827
Author: Abhijeet Malawade <email address hidden>
Date: Tue Jul 28 02:37:16 2015 -0700

    return request_id in case of 500 error

    Request-id is not getting returned if glance throws 500 error
    because context middleware 'process_response' method is not
    getting called.

    Catching generic exception in wsgi Resource class, and returning
    'webob.exc.HTTPInternalServerError' object as response.
    Context middleware adds request-id header to this response object.

    Closes-Bug: #1480196

    Change-Id: I5ed9f64e07c5624f816088113ff67cb03cc8e3f2

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

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/214028

Thierry Carrez (ttx)
Changed in glance:
milestone: none → liberty-3
Thierry Carrez (ttx)
Changed in glance:
status: Fix Committed → Fix Released
Erno Kuvaja (jokke)
Changed in glance:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (stable/kilo)

Reviewed: https://review.openstack.org/214028
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=30f0c409aac31dbf56e006762a662693f109c7b1
Submitter: Jenkins
Branch: stable/kilo

commit 30f0c409aac31dbf56e006762a662693f109c7b1
Author: Abhijeet Malawade <email address hidden>
Date: Tue Jul 28 02:37:16 2015 -0700

    return request_id in case of 500 error

    Request-id is not getting returned if glance throws 500 error
    because context middleware 'process_response' method is not
    getting called.

    Catching generic exception in wsgi Resource class, and returning
    'webob.exc.HTTPInternalServerError' object as response.
    Context middleware adds request-id header to this response object.

    Conflicts:
     glance/common/wsgi.py

    Closes-Bug: #1480196

    Change-Id: I5ed9f64e07c5624f816088113ff67cb03cc8e3f2
    (cherry picked from commit f660846f7ad5da350f1eec9622538cba4ab25827)

Thierry Carrez (ttx)
Changed in glance:
milestone: liberty-3 → 11.0.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on glance (master)

Change abandoned by Glance Bot (<email address hidden>) on branch: master
Review: https://review.openstack.org/207847

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.