getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
7.84k stars 1.54k forks source link

Multiple Events Created for Single Error Event: Remix #12941

Closed ReneGreen27 closed 1 week ago

ReneGreen27 commented 1 month ago

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/remix

SDK Version

7.87.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup/Reproduction Example

No response

Steps to Reproduce

This is identical issue opened for this user back in November 2023 here: https://github.com/getsentry/sentry-javascript/issues/9563. Please reference this past issue

Customer has shared in their wording: "We get multiple (2 or 3?) errors per issue when I expected to get just 1, and none of them seem to have the real error or a stack trace." Customer using most recent version of Remix and when upgraded from Remix 1.19.3 to 2.1 is when they noticed this issue occur.

Here is an example issue regarding receiving multiple events when only one is expected.

Customer's setup details can be found in the internal ticket: https://sentry.zendesk.com/agent/tickets/125250

I was unable to reproduce this issue same as last support engineer and our SDK engineer

Expected Result

One event to be created for single error

Actual Result

Three error events generated for same issue:

https://syncwith.sentry.io/issues/5463741704/events/345e762aa7fd4edab97d8862d9685246/ https://syncwith.sentry.io/issues/5463741704/events/0a3a9c5e51e044beb6e81cde5c819834/ https://syncwith.sentry.io/issues/5463741704/events/66a2dd9cacd6442b8015a56591386969/

raising questions about why there are multiple events for a single error.

Lms24 commented 1 month ago

Hey there,

I took a look at the events and it does appear to be the same error. However, I found one tiny difference between them, namely the Referer header. Not sure how the customer's architecture looks like but perhaps the same error is thrown multiple times due to redirects?

Additionally, I'd recommend updating to the latest v8 version of the SDK (version 8.18.0) and following the setup guide to check that things are up to date. I can see some discrepancies in the code shared on zendesk with what we currently recommend in the docs. Especially for Remix, a lot of our performance-related instrumentation changed with v8 of the SDK which is now powered by OpenTelemetry. I can't guarantee that this solves the problem of these duplicated events but it's definitely worth a shot and makes debugging this further a lot easier.

If this doesn't resolve the issue, I'd ask for a minimal reproduction example. Alternatively, I read in the zendesk ticket that they're willing to add us temporarily to the repo. This could help but I'd still ask for concrete reproduction steps so that we know how to repro the problem.

Also, I'm gonna tag @onurtemizkan - did by chance you come across Unexpected Server Error errors being reported multiple times? Any idea what might be causing this?

onurtemizkan commented 1 month ago

@Lms24, @ReneGreen27, the original issue (https://github.com/getsentry/sentry-javascript/issues/9563) should be resolved in release 7.86.0. And it looks like the same project from the links provided. So I wonder if there's anything missing in the Sentry setup.

I'd also recommend updating to v8, and if it's still happening we can investigate further using a minimal reproduction.

getsantry[bot] commented 2 weeks ago

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀