-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Undici 6.7.0 changes to request headers breaking Sentry code #10936
Comments
Good catch @jessezhang91 - would you be open to opening a PR to fix this? Otherwise we have to backlog in the time being until someone else can get to it. |
I traced down the change to here: but it seems like the docs haven't been updated to reflect that change: so I'm unsure if it's intentional? I'll double check there and apply the updated changes via a PR here when given confirmation. |
Here's my rough attempt at a PR: #10938 I don't have an easy way to test my changes beyond editing the |
Thank you, we'll take a look at the PR in the next days! 🎉 |
Released https://github.com/getsentry/sentry-javascript/releases/tag/7.106.0 with this fix - thanks for contributing @jessezhang91! |
This should fix an issue with undici ``` TypeError: request.headers.split is not a function at setHeadersOnRequest (/usr/src/app/node_modules/@sentry/node/cjs/integrations/undici/index.js:248:39) at _onRequestCreate (/usr/src/app/node_modules/@sentry/node/cjs/integrations/undici/index.js:158:9) at Channel.publish (node:diagnostics_channel:143:9) at new Request (node:internal/deps/undici/undici:6295:27) at [dispatch] (node:internal/deps/undici/undici:9077:25) at Intercept (node:internal/deps/undici/undici:8812:20) at [Intercepted Dispatch] (node:internal/deps/undici/undici:5673:16) at Client.dispatch (node:internal/deps/undici/undici:5689:44) at [dispatch] (node:internal/deps/undici/undici:5920:32) at [Intercepted Dispatch] (node:internal/deps/undici/undici:5666:33) ``` See getsentry/sentry-javascript#10936
This should fix an issue with undici ``` TypeError: request.headers.split is not a function at setHeadersOnRequest (/usr/src/app/node_modules/@sentry/node/cjs/integrations/undici/index.js:248:39) at _onRequestCreate (/usr/src/app/node_modules/@sentry/node/cjs/integrations/undici/index.js:158:9) at Channel.publish (node:diagnostics_channel:143:9) at new Request (node:internal/deps/undici/undici:6295:27) at [dispatch] (node:internal/deps/undici/undici:9077:25) at Intercept (node:internal/deps/undici/undici:8812:20) at [Intercepted Dispatch] (node:internal/deps/undici/undici:5673:16) at Client.dispatch (node:internal/deps/undici/undici:5689:44) at [dispatch] (node:internal/deps/undici/undici:5920:32) at [Intercepted Dispatch] (node:internal/deps/undici/undici:5666:33) ``` See getsentry/sentry-javascript#10936
This should fix an issue tracked down to getsentry/sentry-javascript#10936 by upgrading Sentry SDK (we bumped to 8.x anyway). Thank @Pain4Din0 for reporting.
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
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 undici@6.7.0 changes:
nodejs/undici#2708
nodejs/undici#2879
and this line of code here:
sentry-javascript/packages/node/src/integrations/undici/index.ts
Line 311 in a818271
Since the headers can now be arrays and iterables, this might not be properly accounting for that when attempting to call
.split()
.Pinning to undici@6.6.2 does not exhibit this behavior.
Expected Result
No errors
Actual Result
The text was updated successfully, but these errors were encountered: