global_request_id is not set in the req.environ

Bug #1800978 reported by Tushar Patil on 2018-11-01
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Neha Alhat

Bug Description

If I pass 'X-Openstack-Request-Id' in the request headers, RequestId oslo.middleware should set 'openstack.global_request_id' in the req.environ but it's not setting it correctly as it's getting 'HTTP_X_OPENSTACK_REQUEST_ID' in the request header instead of 'X-Openstack-Request-Id' due to which global_request_id is not logged in the nova-api service log file.

$curl -g -i -X GET -H "Accept: application/json" -H "OpenStack-API-Version: compute 2.67" -H "User-Agent: python-novaclient" -H "X-Auth-Token: gAAAAABb2mTlsGotppBZn5JLLNHz0PqKObqOQPM6KioPpmbi2lfxM4h_PRn7W45RBjwDlfMRjCOu0DR9ogevlc9QORAq7eiG7HNy0MXiQa42lEtUBtlKtKl7VEHl8ZKd7TVMW-aDYb2DcEMxaXV2AesEzHNV9YWcvUMs4bN6f_j2OYw_VAQb07I" -H "X-OpenStack-Nova-API-Version: 2.67" -H "X-Openstack-Request-Id: e19f8f4f-40e7-441e-b776-7b43ed15c7dd"

Request headers

I have observed same issue with placement-api service. Both of these services uses webob framework.

I wrote a simple webob application [1] to check whether it adds prefix HTTP and converts it to uppercase or not and observed that webob is a culprit.

Not all OpenStack services uses webob framework. Flask doesn't modify HTTP headers. Maybe, we will need to modify RequestId middleware to handle both 'HTTP_X_OPENSTACK_REQUEST_ID' and 'X-Openstack-Request-Id' cases.

[1] :

Neha Alhat (nehaalhat) on 2018-11-01
Changed in oslo.middleware:
assignee: nobody → Neha Alhat (nehaalhat)
Tushar Patil (tpatil) wrote :

If you want to pass global_request_id in 'X-OpenStack-Request-Id' request header, then it should adhere to this format [1]. After passing correct uuid "eq-e19f8f4f-40e7-441e-b776-7b43ed15c7dd" in 'X-OpenStack-Request-Id' request header, I can see global_request_id in the respective service logs.

Marking this bug as invalid.

[1] :

Changed in oslo.middleware:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers