Sentry-javascript: UnhandledRejection: Non-Error promise rejection captured with value: Timeout

Created on 25 Mar 2020  ·  14Comments  ·  Source: getsentry/sentry-javascript

Package + Version

@sentry/[email protected]

Description

We are receiving a high volume of exceptions that follow the same signature. They occur across all pages, and in all sorts of places with seemingly no discernible pattern. It occurs across all browsers with frequency roughly the same as usage.

UnhandledRejection
Non-Error promise rejection captured with value: Timeout

In all cases the Exception is missing. There is no stack trace or additional information.

I'm pretty certain this is originating from third-party code, but without more information to go on I've been unable to pin this down.

I'm opening this as a bug because it feels like Sentry should be reporting additional information to help pinpoint the source of the error.

There is an existing issue for this that has been closed without any resolution: https://github.com/getsentry/sentry-javascript/issues/2210

Discussion

Most helpful comment

The issue lies exactly there: https://www.gstatic.com/recaptcha/releases/P6KLRNy7h3K160ZmYNUOAce7/recaptcha__en.js

c.reject("Timeout ("+y+")")

or

H((vn.delete(P),"Timeout")

tl;dr - they reject with a primitive value, but should with new Error("timeout").

In this case, your best solution until they fix it is to ignore this kind of errors.

Sentry.init({
  beforeSend(event, hint) {
    if (hint.originalException === "Timeout") return null;
    return event;
  }
});

All 14 comments

We had multiple issues like this and pinned it down to google recaptcha code. It is very flaky, so we got rid of recaptcha and errors disappeared

@JustFly1984 Thanks for the confirmation. Recaptcha is my prime suspect. Unfortunately we cannot remove it. Looks like it maybe doesn't unmount properly. Still feels like we should be able to get more info from the exception though.

I’ve failed an issue in google bug tracker, but they don’t give a sheet

@JustFly1984 Yep. That's Google for for you. No sheets given.

The issue lies exactly there: https://www.gstatic.com/recaptcha/releases/P6KLRNy7h3K160ZmYNUOAce7/recaptcha__en.js

c.reject("Timeout ("+y+")")

or

H((vn.delete(P),"Timeout")

tl;dr - they reject with a primitive value, but should with new Error("timeout").

In this case, your best solution until they fix it is to ignore this kind of errors.

Sentry.init({
  beforeSend(event, hint) {
    if (hint.originalException === "Timeout") return null;
    return event;
  }
});

@kamilogorek Thanks. Interested why you would filter this out in beforeSend on the client rather than just ignoring in the dashboard?

Because this error is too generic. Too easy to get a false positive match.
Also, I've never seen this exact Timeout error before :D

@kamilogorek Yeah. I guess my concern is that filtering it out on the client might end up masking important errors. At least if you ignore it on the dashboard you still have the data stored.

@Undistraction filtered events are dropped for the end user. Otherwise, they'd count toward quota.

@kamilogorek Ah. I hadn't considered quota. Thanks for clarifying.

Does anybody know how this timeout affects end users?

Closing the issue, as it seems like the original issue has been partially resolved or there is a working solution. I'd prefer someone to create a new issue with a fresh description if it's still an issue.
Please do not hesitate to ping me if it is still relevant, and I will happily reopen and work on it.
Cheers!

@kamilogorek so this timeout issue is not affected to end users and it is good solution to ignore this one?

It depends on how your codebase is tied to the ReCaptcha SDK, but I'd say that in general, in most cases yes, it shouldn't affect the end outcome.

Was this page helpful?
0 / 5 - 0 ratings