Skip to content
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

http integration: sentry adds the same header many times: 'The number of request header fields exceeds this server's limit' #8654

Closed
3 tasks done
Andrei-Stepanov opened this issue Jul 26, 2023 · 3 comments · Fixed by #8657
Assignees
Labels
Package: node Issues related to the Sentry Node SDK Type: Bug

Comments

@Andrei-Stepanov
Copy link

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

7.60.0

Framework Version

No response

Link to Sentry event

https://red-hat-it.sentry.io/issues/4323333831/?project=4505158884196352&query=is%3Aunresolved&referrer=issue-stream&stream_index=0

SDK Setup

https://github.com/fedora-ci/ciboard-server/blob/29be9f40dca07d8cc393d81704442c592eaa0e5e/src/server.ts#L59

Sentry.init({
  integrations: [
    // Enable HTTP calls tracing.
    new Sentry.Integrations.Http({ tracing: true }),
    // Enable Express.js middleware tracing.
    new Sentry.Integrations.Express({ app }),
    // Automatically instrument Node.js libraries and frameworks.
    ...Sentry.autoDiscoverNodePerformanceMonitoringIntegrations(),
  ],
  release: process.env.CIBOARD_SERVER_GIT_COMMIT || 'custom-build',
})

Steps to Reproduce

Bug is in:

https://docs.sentry.io/platforms/node/configuration/integrations/default-integrations/#http

Start sending HTTPS requests.

Sentry adds tons HTTP-headers.

Expected Result

Sentry do not spoil http traffic with duplicated entries of the same header.

Actual Result

Sentry adds the same header tons of times:

req headers: POST /brewhub HTTP/1.1
useragent: ciboard-server
User-Agent: NodeJS XML-RPC Client
Content-Type: text/xml
Accept: text/xml
Accept-Charset: UTF8
Connection: Keep-Alive
Content-Length: 324
sentry-trace: dfda641419e54f7f954ae2208f6d2c91-8754a115bfefa680-0
baggage: sentry-environment=production,sentry-release=756212cc5e502f60527c45f2213a0eb34e13fa04,sentry-public_key=86cf439ffd454a21bec26faae0da9962,sentry-trace_id=ca1d026ad267460297f064fda63470c9
baggage: sentry-environment=production,sentry-release=756212cc5e502f60527c45f2213a0eb34e13fa04,sentry-public_key=86cf439ffd454a21bec26faae0da9962,sentry-trace_id=ca1d026ad267460297f064fda63470c9
baggage: sentry-environment=production,sentry-release=756212cc5e502f60527c45f2213a0eb34e13fa04,sentry-public_key=86cf439ffd454a21bec26faae0da9962,sentry-trace_id=ca1d026ad267460297f064fda63470c9
baggage: sentry-environment=production,sentry-release=756212cc5e502f60527c45f2213a0eb34e13fa04,sentry-public_key=86cf439ffd454a21bec26faae0da9962,sentry-trace_id=ca1d026ad267460297f064fda63470c9
@AbhiPrasad
Copy link
Member

@Andrei-Stepanov thanks for reporting, sorry for the trouble!

I wonder how this is possible - we should only be attaching the headers a single time, but let me add a guard that hopefully prevent this.

I opened #8657 as a possible fix for this.

@AbhiPrasad AbhiPrasad added Package: node Issues related to the Sentry Node SDK and removed Package: browser Issues related to the Sentry Browser SDK Waiting for: Product Owner labels Jul 26, 2023
@AbhiPrasad AbhiPrasad self-assigned this Jul 26, 2023
@Andrei-Stepanov
Copy link
Author

Hello,
Just a small addition:

It starts to happen over time. When our app starts all looks good.
The sentry-headers started to accumulate in http-requests over time.

Thank you.

@Andrei-Stepanov
Copy link
Author

@AbhiPrasad thank you for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: node Issues related to the Sentry Node SDK Type: Bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants