Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
9.24.0
Framework Version
No response
Link to Sentry event
No response
Reproduction Example/SDK Setup
No response
Steps to Reproduce
Stacktrace:
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
at ClientRequest.setHeader (node:_http_outgoing:642:11)
at SentryHttpInstrumentation._onOutgoingRequestCreated (/Users/finn/workspaces/typie/node_modules/.pnpm/@sentry+node@9.24.0/node_modules/@sentry/node/src/integrations/http/SentryHttpInstrumentation.ts:265:15)
at onHttpClientRequestCreated (/Users/finn/workspaces/typie/node_modules/.pnpm/@sentry+node@9.24.0/node_modules/@sentry/node/src/integrations/http/SentryHttpInstrumentation.ts:167:12)
at Channel.publish (node:diagnostics_channel:150:9)
at new ClientRequest (node:_http_client:384:35)
at request (node:https:381:10)
at /Users/finn/workspaces/typie/node_modules/.pnpm/@smithy+node-http-handler@4.0.6/node_modules/@smithy/node-http-handler/dist-cjs/index.js:366:19
at new Promise (<anonymous>)
at _NodeHttpHandler.handle (/Users/finn/workspaces/typie/node_modules/.pnpm/@smithy+node-http-handler@4.0.6/node_modules/@smithy/node-http-handler/dist-cjs/index.js:300:12)
at /Users/finn/workspaces/typie/node_modules/.pnpm/@smithy+smithy-client@4.4.1/node_modules/@smithy/smithy-client/dist-cjs/index.js:155:35 {
code: 'ERR_HTTP_HEADERS_SENT'
Sentry initialization:
Sentry.init({
dsn: "<actual dsn>",
});
Code that causes trouble:
await aws.s3.send(
new PutObjectCommand({
Bucket: '<bucket name>',
Key: `<some key>`,
Body: <buffer>,
}),
);
package.json:
"@aws-sdk/client-s3": "^3.812.0",
"@sentry/node": "^9.24.0",
node -v:
As a temporary workaround, setting tracePropagationTargets: [] solves the issue.
Expected Result
Code works well.
Actual Result
It does not.
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
9.24.0
Framework Version
No response
Link to Sentry event
No response
Reproduction Example/SDK Setup
No response
Steps to Reproduce
Stacktrace:
Sentry initialization:
Code that causes trouble:
package.json:
node -v:
As a temporary workaround, setting
tracePropagationTargets: []solves the issue.Expected Result
Code works well.
Actual Result
It does not.