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

Vercel integration is causing runtime errors in undici integration #12218

Closed
3 tasks done
bryanrsmith opened this issue May 24, 2024 · 9 comments
Closed
3 tasks done

Vercel integration is causing runtime errors in undici integration #12218

bryanrsmith opened this issue May 24, 2024 · 9 comments
Labels
Package: node Issues related to the Sentry Node SDK Type: Bug

Comments

@bryanrsmith
Copy link

bryanrsmith commented May 24, 2024

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.101.1

Framework Version

No response

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

Sometime between the evening of May 23 and morning of May 24 all of my Vercel projects that use @sentry/node have started producing runtime errors when using native fetch (undici). I have made no relevant code changes in that time frame (deployments are being triggered by webhooks from my CMS). Projects build successfully as normal, but my pre-deployment tests fail, preventing Vercel from aliasing the new deployments to production. All serverless functions that make fetch calls appear to be crashing with the following error:

TypeError: request.headers.split is not a function
at setHeadersOnRequest (/var/task/node_modules/@sentry/node/cjs/integrations/undici/index.js:266:39)
at _onRequestCreate (/var/task/node_modules/@sentry/node/cjs/integrations/undici/index.js:177:7)
at Channel.publish (node:diagnostics_channel:143:9)
at new Request (node:internal/deps/undici/undici:6295:27)
at Client.[dispatch] (node:internal/deps/undici/undici:9077:25)
at Intercept (node:internal/deps/undici/undici:8812:20)
at Client.[Intercepted Dispatch] (node:internal/deps/undici/undici:5673:16)
at Client.dispatch (node:internal/deps/undici/undici:5689:44)
at Pool.[dispatch] (node:internal/deps/undici/undici:5920:32)
at Pool.[Intercepted Dispatch] (node:internal/deps/undici/undici:5666:33)
Node.js process exited with exit status: 129. The logs above can help with debugging the issue.

Disabling Sentry by commenting out the Sentry.init() call has allowed me to resume deploying my projects.

Expected Result

Sentry instrumentation shouldn't break the app :-)

Actual Result

All node.js serverless functions crash with the following error:

TypeError: request.headers.split is not a function
at setHeadersOnRequest (/var/task/node_modules/@sentry/node/cjs/integrations/undici/index.js:266:39)
at _onRequestCreate (/var/task/node_modules/@sentry/node/cjs/integrations/undici/index.js:177:7)
at Channel.publish (node:diagnostics_channel:143:9)
at new Request (node:internal/deps/undici/undici:6295:27)
at Client.[dispatch] (node:internal/deps/undici/undici:9077:25)
at Intercept (node:internal/deps/undici/undici:8812:20)
at Client.[Intercepted Dispatch] (node:internal/deps/undici/undici:5673:16)
at Client.dispatch (node:internal/deps/undici/undici:5689:44)
at Pool.[dispatch] (node:internal/deps/undici/undici:5920:32)
at Pool.[Intercepted Dispatch] (node:internal/deps/undici/undici:5666:33)
Node.js process exited with exit status: 129. The logs above can help with debugging the issue.

@github-actions github-actions bot added the Package: node Issues related to the Sentry Node SDK label May 24, 2024
@trevcarr95
Copy link

trevcarr95 commented May 24, 2024

having the same issue with serverless functions in our production vercel deployments. posted timeline matches with timeline in which our issues began - sometime between night of May 23 and morning of May 24

@AbhiPrasad
Copy link
Member

AbhiPrasad commented May 24, 2024

#10936

This was an bug in Node.js itself with Undici unfortunately - they released a breaking change in a minor. This was fixed with 7.106.0: https://github.com/getsentry/sentry-javascript/releases/tag/7.106.0. Please upgrade your SDK! Thanks :)

@AbhiPrasad
Copy link
Member

This is also already fixed on Sentry 8.x for those who are using the new major version.

@bryanrsmith
Copy link
Author

Got it. Vercel's runtime must have updated last night, exposing us to this issue. Will update the SDK. Thanks!

@pdparchitect
Copy link

Vercel loves making fundamental changes on Friday. This is not the first time.

@Damola18
Copy link

I use @sentry/nextjs and i get this error as well. Installing the latest version of @sentry/nextjs doesnt fix it.
Uncaught Exception: TypeError: request.headers.split is not a function
at setHeadersOnRequest (/var/task/node_modules/@sentry/nextjs/node_modules/@sentry/node/cjs/integrations/undici/index.js:247:39)
at _onRequestCreate (/var/task/node_modules/@sentry/nextjs/node_modules/@sentry/node/cjs/integrations/undici/index.js:151: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)
Node.js process exited with exit status: 129. The logs above can help with debugging the issue.

@AbhiPrasad
Copy link
Member

@Damola18 please open a new GitHub issue and fill out the issue template! We can take a look to see what the issue is.

Please also add the output of npm list @sentry/nextjs to that issue.

@Damola18
Copy link

@Damola18 please open a new GitHub issue and fill out the issue template! We can take a look to see what the issue is.

Please also add the output of npm list @sentry/nextjs to that issue.

Will do that

@Damola18
Copy link

@Damola18 please open a new GitHub issue and fill out the issue template! We can take a look to see what the issue is.

Please also add the output of npm list @sentry/nextjs to that issue.

Will do that

@AbhiPrasad already did

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

No branches or pull requests

5 participants