-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sentry's baggage header breaks the request #2219
Comments
I'm able to reproduce this and confirm it seems to be an issue in this repo's RPC proxy for this endpoint: Sending through the API proxy:
Sending directly to a stacks-node:
|
@rafaelcr I'll try to tackle this next week. But feel free to take it if you want, if I haven't yet moved the ticket to in-progress. |
I had some time to look into this today and found some interesting things:
Furthermore, I found that the problem is the Do you have a clue on what could be the cause here @CharlieC3 ? i.e. do you know if there's an internal k8s routing thing that might be rewriting the value of the forwarded header? |
I think I may have more info to offer here. I was able to confirm I was seeing the same issue as above, and that changing the Some findings:
@rafaelcr @zone117x Does the API happen to use Sentry? Or rather does it have any tracing-adjacent libraries that would intercept the Typically Sentry or tracing libraries are only "active" in a deployed production environment. @rafaelcr This might explain why you're not seeing this problem when running it locally. |
Nice cache on the duplicate header. I'm not sure yet where the extra Before we look into that, @CharlieC3 can Istio be configured to handle this (de-dupe / merge duplicate headers)? |
Istio already normalizes headers by default, so I'm not entirely sure how a duplicate is sneaking though. I agree though that this is an issue on the stacks-core end, I'll follow it up with some core devs. |
Describe the bug
The header baggage set by sentry (referenced here), when present in the request, breaks it and we get back :
Received an HTTP message that the node could not decode
To Reproduce
Curl with baggage header set:
curl 'https://api.mainnet.hiro.so/v2/fees/transaction'
-H 'Content-Type: application/json'
-H 'baggage: sentry-environment=production'
--data-raw '{"transaction_payload":"000516a66269b5011c8feb0eb8ca6fe39ecef63a8b6c7b000000000000000048686a00000000000000000000000000000000000000000000000000000000000000","estimated_len":180}'
The same without the baggage header, which works:
curl 'https://api.mainnet.hiro.so/v2/fees/transaction'
-H 'Content-Type: application/json'
--data-raw '{"transaction_payload":"000516a66269b5011c8feb0eb8ca6fe39ecef63a8b6c7b000000000000000048686a00000000000000000000000000000000000000000000000000000000000000","estimated_len":180}'
Expected behavior
When present, the baggage header shouldn't make the node unable to decode the message.
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: