Closed
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
7.105.0
Framework Version
No response
Link to Sentry event
No response
SDK Setup
No response
Steps to Reproduce
I can't figure out how to reproduce it locally but the issue occurs immediately on our staging and production servers for some reason.
I think it's related to [email protected] changes:
nodejs/undici#2708
nodejs/undici#2879
and this line of code here:
Since the headers can now be arrays and iterables, this might not be properly accounting for that when attempting to call .split()
.
Pinning to [email protected] does not exhibit this behavior.
Expected Result
No errors
Actual Result
TypeError: request.headers.split is not a function
File "/var/app/node_modules/@sentry/node/cjs/integrations/undici/index.js", line 266, col 39, in setHeadersOnRequest
const headerLines = request.headers.split('\r\n');
File "/var/app/node_modules/@sentry/node/cjs/integrations/undici/index.js", line 177, col 7, in _onRequestCreate
setHeadersOnRequest(request, sentryTraceHeader, sentryBaggageHeader);
File "node:diagnostics_channel", line 142, col 9, in Channel.publish
File "/var/app/node_modules/undici/lib/core/request.js", line 189, col 23, in new Request
channels.create.publish({ request: this })
File "/var/app/node_modules/undici/lib/dispatcher/client.js", line 294, col 21, in [dispatch]
const request = new Request(origin, opts, handler)
File "/var/app/node_modules/undici/lib/interceptor/redirect-interceptor.js", line 11, col 16, in Intercept
return dispatch(opts, handler)
File "/var/app/node_modules/undici/lib/dispatcher/dispatcher-base.js", line 158, col 12, in [Intercepted Dispatch]
return dispatch(opts, handler)
File "/var/app/node_modules/undici/lib/dispatcher/dispatcher-base.js", line 179, col 40, in Client.dispatch
return this[kInterceptedDispatch](opts, handler)
File "/var/app/node_modules/undici/lib/dispatcher/pool-base.js", line 143, col 28, in [dispatch]
} else if (!dispatcher.dispatch(opts, handler)) {
File "/var/app/node_modules/undici/lib/dispatcher/dispatcher-base.js", line 150, col 29, in [Intercepted Dispatch]
return this[kDispatch](opts, handler)
File "/var/app/node_modules/undici/lib/dispatcher/dispatcher-base.js", line 179, col 40, in Pool.dispatch
return this[kInterceptedDispatch](opts, handler)
File "/var/app/node_modules/undici/lib/dispatcher/agent.js", line 105, col 23, in [dispatch]
return dispatcher.dispatch(opts, handler)
File "/var/app/node_modules/undici/lib/interceptor/redirect-interceptor.js", line 11, col 16, in Intercept
return dispatch(opts, handler)
File "/var/app/node_modules/undici/lib/dispatcher/dispatcher-base.js", line 158, col 12, in [Intercepted Dispatch]
return dispatch(opts, handler)
File "/var/app/node_modules/undici/lib/dispatcher/dispatcher-base.js", line 179, col 40, in Agent.dispatch
return this[kInterceptedDispatch](opts, handler)
File "node:internal/deps/undici/undici", line 10929, col 55, in <anonymous>
Metadata
Metadata
Assignees
Type
Projects
Status
No status