Bug 1173139 - candlepin is not sending x-candlepin-request-uuid header in responses
Summary: candlepin is not sending x-candlepin-request-uuid header in responses
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 0.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Filip Nguyen
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-12-11 14:04 UTC by Adrian Likins
Modified: 2016-11-11 00:42 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-09-14 14:34:33 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1393010 0 high CLOSED [RFE] Log the candlepin request ID with the request response 2021-02-22 00:41:40 UTC

Internal Links: 1393010

Description Adrian Likins 2014-12-11 14:04:30 UTC
Description of problem:

For standalone or hosted candlepin, the x-candlepin-request-uuid header is not being sent. It is being logged to the candlepin and access log. But it is not sent out via the http header, so the client never sees it, and never logs it.

The requestUuid was meant to be able to connect client requests and logs and errors with server logs, but the client side doesn't get the info.

It looks like the ServletResponse is trying to set the header using a header name pulled from the configuration, but the config lookup to get "header.name" from the config gets null, so the servlet response doesn't get the header set.

Note the server does log the requestUuid and it does seem to be attached to the request mdc, but it attempts to set a header of "null: requestUuid"

I suspect it's just a guice init issue. 

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Adrian Likins 2014-12-11 14:06:22 UTC
Maybe server/src/main/java/org/candlepin/guice/CandlepinFilterModule.java isn't passing the LoggingFilterConfig to the right places? Seems like the values set there aren't known by ServletResponses

Comment 2 Filip Nguyen 2015-09-14 14:34:33 UTC
Works in master: 

curl -i -k -u admin:admin "https://localhost:8443/candlepin/status"
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
x-candlepin-request-uuid: 4f3dab4d-55d2-40e7-8306-c9c613b5c275
X-Version: 2.0.6-1
Content-Type: application/json
Transfer-Encoding: chunked
Date: Mon, 14 Sep 2015 14:33:49 GMT

{"result":true,"version":"2.0.6","rulesVersion":"5.17","release":"1","standalone":true,"timeUTC":"2015-09-14T14:33:49.316+0000","managerCapabilities":["cores","ram","instance_multiplier","derived_product","cert_v3","guest_limit","vcpu","hypervisors_async","storage_band"],"rulesSource":"DEFAULT"}


Note You need to log in before you can comment on or make changes to this bug.