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
8.26.0
Framework Version
Node v20.12.2
Link to Sentry event
First error's local variables (endpoint fees/33/fee
) are blank: https://clearbanc.sentry.io/issues/5724968061/events/13ac4e69d73e4cb6b79160830ef972f7/
First error's local variables are on the SECOND error's call (endpoint fees/44/fee
) https://clearbanc.sentry.io/issues/5724968061/events/f697d4fe012e408d8fea4241d6d3c786/
Reproduction Example/SDK Setup
SDK setup:
Sentry.init({
dsn: process.env.SENTRY_DSN,
includeLocalVariables: true,
});
Unfortunately because it's a race condition it may be hard to reproduce without very specific code, error behaviour, and hardware. Hopefully you can trust that it does happen as an edge case and we can find some way to gate frame checks to wait for the debugger or something?
Steps to Reproduce
- startup the nodejs app fresh
- init sentry with
includeLocalVariables: true
- trigger/capture an exception with local var state A
- trigger/capture an exception with local var state B
Expected Result
Sentry UI should show exception #1 with state A and exception #2 with state B
Actual Result
Sentry UI shows exception #1 with NO state, and exception #2 with state A.
I dug into this and it appears there is a race condition with cachedFrames where we check the LRU cache for frames before the worker sends the frame info message to populate the cache. So then the second time the error is captured, it will receive the previous frame's information that was never consumed the first time. And then the worker sends the second frame's late, repeating ad nauseum.
Metadata
Metadata
Assignees
Type
Projects
Status