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

@sentry/node throws error #13574

Closed
3 tasks done
jmoseley opened this issue Sep 3, 2024 · 7 comments · Fixed by #13581
Closed
3 tasks done

@sentry/node throws error #13574

jmoseley opened this issue Sep 3, 2024 · 7 comments · Fixed by #13581
Labels
Package: node Issues related to the Sentry Node SDK

Comments

@jmoseley
Copy link

jmoseley commented Sep 3, 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

8.28.0

Framework Version

No response

Link to Sentry event

https://cortex-click.sentry.io/issues/5792808360/events/a6cdf06b7c194f8eb107bcd8bea91d36/

Reproduction Example/SDK Setup

No response

Steps to Reproduce

It is unclear what situation triggers this issue, but this is crashing our application.

Expected Result

No error should be thrown. If it is thrown, it should be caught and not crash the process.

Actual Result

Image

@github-actions github-actions bot added the Package: node Issues related to the Sentry Node SDK label Sep 3, 2024
@s1gr1d
Copy link
Member

s1gr1d commented Sep 4, 2024

I was not able to reproduce it, but I created a PR which could fix this: #13581

Please tell me if you still run in this problem after we released it.

@jmoseley
Copy link
Author

jmoseley commented Sep 4, 2024

Thanks for the swift response. I'm sorry for the lack of reproducibility. I'm quite confused as to how this might be affecting me, but not everyone else that uses Sentry and fetch. It may be related to the openai package, but I wasn't able to validate that for sure.

The OTel package also suffers from this problem (as I discovered trying to work around this by downgrading).

@s1gr1d
Copy link
Member

s1gr1d commented Sep 5, 2024

What exactly do you mean by "the OTel package also suffers from this problem"? Do you get the same error message when using OTel?

@jmoseley
Copy link
Author

jmoseley commented Sep 5, 2024

I downgraded @sentry/node to before this problematic code was added, and I got a similar error thrown by opentelemetry-instrumentation-fetch-node.

https://github.com/gas-buddy/opentelemetry-instrumentation-fetch-node/blob/e44a4c3e0ba905b1e6d415be3bdf807f289402d1/src/index.ts#L247

I'm still confused as to why both of these places assume the Request object has an origin property, when that is not part of the spec, as far as I can tell.

More confusing is how I am the first person discovering this issue. The lack of prior reports makes me assume I must be doing something out-of-the-ordinary. But we have a pretty standard Typescript/Express app running in Node 20, so nothing strange as far as I can tell.

@s1gr1d
Copy link
Member

s1gr1d commented Sep 6, 2024

This could also be an issue in OTel. They use undici and it seems like undici is adding the origin property (here is the file: https://github.com/nodejs/undici/blob/main/lib/core/request.js).

Possibly, it is a URL object which is coming in and then it cannot call the function.

@jmoseley
Copy link
Author

jmoseley commented Sep 6, 2024

Ah that makes a ton of sense.

@AbhiPrasad
Copy link
Member

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
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants