-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Very uninformative onunhandledrejection errors when rejecting with Event #2210
Comments
For the time being, I've added a beforeSend: function(event, hint) {
if (hint && hint.originalException instanceof Event) {
event.extra.isTrusted = hint.originalException.isTrusted;
event.extra.detail = hint.originalException.detail;
event.extra.type = hint.originalException.type;
}
return event;
}, BTW. |
I'm experiencing this, too, and I think that Sentry needs to handle non-Error types properly, rather than treating them like an error. I'm still working through the problem and I tried adding this code to wrap objects in an Error type, but this didn't fix the problem:
Next, I'm going to try using I would actually disagree with the title of this issue -- I don't think that Sentry is being uninformative, I think it's actually informing developers that Sentry doesn't properly handle some types of common javascript errors (ie. thrown objects that aren't of instance type: Error). I see this as being an actual bug in Sentry, because a thrown Object in javascript is still an Exception/Error, even if the thrown object is not of Error type IMO. I'm not sure where the javascript community would stand on this, admittedly (https://stackoverflow.com/questions/9156176/what-is-the-difference-between-throw-new-error-and-throw-someobject) |
What would it achieve to wrap non-error with Error? Are you expecting to get stack trace as a result? I I'm not sure that would work with native |
Wrapping a non-Error in Error was just to get the correct format for compatibility and also typing. I have experienced several third party libraries that throw objects that have some information about the error but the nature of the error is . It is somewhere between an event and an error. For instance, Google Analytics throws this object:
Which is an error that I'd like to know about in Sentry and it makes it all of the way to Sentry's captureException, but google throws it as an object instead of an Error (as far as I can tell), so Sentry doesn't handle it in the a way that is intuitive to me. Javascript users should throw Errors, but the language allows them to throw plain objects, and sometimes they do. Those objects often contain error information that is helpful for debugging (the google example tells me everything I need to know) even without a stacktrace A dynamic version of @rchl 's strategy would make sense to me -- iterate through the object keys and attach them to |
With But your usecase is already handled in latest Sentry version. You get |
Sometimes the object/event has a message key, I would much prefer it if that were used for the wrapped exception message... |
I'm currently receiving thousands of instances of this error from a relatively small number of users. Since I'm just testing out Sentry right now with a free plan, there's no way to filter them out. Spike Protection also does not seem to react to this issue. |
@cynicaloptimist I hope this isn't pointing out the obvious, but a quick patch is just to filter them out on your client, assuming the errors are all the same type. In my case, it was a warning from social login buttons when I was in dev mode. |
@ajhool yep, I'll probably do that if the issue persists and I decide to keep using Sentry. I thought it might be helpful to report the impact to this Issue discussion. |
I scheduled better @mogelbrod is there a way you can provide a repro-case for this? We never had an issue with TraceKit incorrectly detecting Error instances. As for your additional enumerables, we have an integration for this – https://docs.sentry.io/platforms/javascript/#extraerrordata import * as Sentry from '@sentry/browser';
import { ExtraErrorData } from '@sentry/integrations';
Sentry.init({
integrations: [new Integrations.ExtraErrorData()]
}); is basically equivalent of your |
Most of the Non-Error promise rejection captured errors are reported from IE11, so I'm guessing it's another case of IE not behaving. In 3 out of 4 cases we've added properties to the error before throwing, which I initially suspected might cause IE to no longer consider it an
Here are some example issues from our production environment:
|
@mogelbrod for us it's almost exclusively Chrome, not IE. 98% out of approximately 40k reports. |
I'm having the same issue, but for various browsers/visitors In additional data, I have the error as a
or
or others Using Sentry 5.6.3 |
@karol-majewski Google Chrome plugins were triggering some of these events for me. Adblocker was triggering a social login complaint that wouldn't have been triggered in IE. I am also seeing this behavior from mulitple devices and browsers |
@ajhool Thanks for the update. As for devices, there is another anomaly. This error only happens on two devices:
What's even more interesting, the |
We're also seeing a lot of these - over 35k |
I just rolled out
It improves events serialization and unifies some differences between reject/onerror/manual error handling. It also removes any dependencies that were necessary for IE10/11, including Promises, so we have to make sure it's working correctly. Any feedback appreciated! :) |
@kamilogorek I tried running it but was unable to get the project to build because of type definition errors. The declare module 'domain' {
let active: Domain;
/**
* Extension for domain interface
*/
interface Domain {
__SENTRY__?: Carrier;
}
} Console output: I'm also using:
|
@karol-majewski it looks like the versions are out of sync. What's your current setup? Are you talking about the new beta version? (as you listed 5.6) |
@kamilogorek Updating all the accompanying packages seems to have helped, thank you. |
Hi, would this issue be related to #424 that brought by a third party promise library even thought it's the legacy SDK? https://docs.sentry.io/clients/javascript/usage/#raven-js-promises |
@brandonburkett No I still have the same issue popping almost every second for some users until we eat all our quota and hope that next month it will be solved ... 😥 |
Could it be that the Chrome violations are being interpreted as something that requires an error to be thrown? reference link: https://stackoverflow.com/questions/41218507/violation-long-running-javascript-task-took-xx-ms/41218580 |
I have the same error happening frequently in our sentry project.
Traced it to the same unknown chrome extension mentioned above:
|
As this thread got really large. First, please update the version of the SDK to the newest one, and then please open a new issue detailing what, where and how it is happening, so we can start to fix them one by one. Thanks! |
I've got 75K events from this chrome extension and it ate my quota
@kamilogorek should a new issue be opened? |
@ilanbm can you provide a link to the event from your screenshot? I'd like to take a closer look at it. |
|
I wonder if these "installed outside of web store" extensions can also be filtered out with the |
@brandonburkett BTW real errors generated by misconfiguring CSP correctly goes to Sentry logs |
@JustFly1984 Got it. Unfortunately my CSP are pretty limited do to adsense. We get quite a few chrome extension sentry logs that usually eats our quota in about a week :( We are also filtering via configuration |
@brandonburkett we had used reportOnly CSP with strict rules to gather valid and invalid CSP rules, to make CSP as strict as possible before applying it to production. This way we can prevent malicious browser extensions from messing with our code. |
Same issue today with this extension & version 5.15.0 upgraded to 5.15.5: https://sentry.io/share/issue/3461d17193c64e1d980cd6d41a66ba23/ |
Version: 5.15.5 I have tried to reduce an error noise by setting ignoreErrors and blacklistUrls as described here https://docs.sentry.io/platforms/javascript/#decluttering-sentry Sentry.init({
dsn,
ignoreErrors: [
// Random plugins/extensions
'top.GLOBALS',
// See: http://blog.errorception.com/2012/03/tale-of-unfindable-js-error.html
'originalCreateNotification',
'canvas.contentDocument',
'MyApp_RemoveAllHighlights',
'http://tt.epicplay.com',
'Can\'t find variable: ZiteReader',
'jigsaw is not defined',
'ComboSearch is not defined',
'http://loading.retry.widdit.com/',
'atomicFindClose',
// Facebook borked
'fb_xd_fragment',
// ISP "optimizing" proxy - `Cache-Control: no-transform` seems to
// reduce this. (thanks @acdha)
// See http://stackoverflow.com/questions/4113268
'bmi_SafeAddOnload',
'EBCallBackMessageReceived',
// See http://toolbar.conduit.com/Developer/HtmlAndGadget/Methods/JSInjection.aspx
'conduitPage'
],
blacklistUrls: [
// Facebook flakiness
/graph\.facebook\.com/i,
// Facebook blocked
/connect\.facebook\.net\/en_US\/all\.js/i,
// Woopra flakiness
/eatdifferent\.com\.woopra-ns\.com/i,
/static\.woopra\.com\/js\/woopra\.js/i,
// Chrome extensions
/extensions\//i,
/^chrome:\/\//i,
// Other plugins
/127\.0\.0\.1:4001\/isrunning/i, // Cacaoweb
/webappstoolbarba\.texthelp\.com\//i,
/metrics\.itunes\.apple\.com\.edgesuite\.net\//i
]
}); Yet I still receive those errors. Is there anything I can do? Because it's eating my quota. |
@kiruh it should be easily filtered with per-project setting: |
Version 5.15.5 Setting to filter out browser extension errors is enabled: We're still receiving loads of these errors:
Breadcrumbs:
If there was a way to reproduce this error then I would try to dig in to the code that was supposed to fix this (added in #2429), but it seems nobody has a way to reproduce this. 😢 Note that these errors are coming from users running even the most recent versions of our app, long after we upgraded Sentry to 5.15.5. Maybe #2429 does not help because |
I believe the A student on a device with GoGuardian Beacon (force-)installed and using Sentry probably caused the error. |
Hello @OliverJAsh, we have the same uninformative logs as your case at the serialized section |
Hi, |
@fyelci did you happen to find out more about it? Experiencing the same issue here, only Safari users on Mac. |
@jacprada no I couldn't find a solution for this. Just ignored that and didn't happen again. |
Very long thread. Any solution here? |
It's all use-case specific, so you need to trace the issue in your project using |
We are facing the same issue with our organisation , one issue as Attached the issue : https://sentry.io/share/issue/3a30791dc94c436292f9265fcd178ae8/ Attached the devices image as well can any one help me with how to solve this |
Package + Version
@sentry/browser
@sentry/node
raven-js
raven-node
(raven for node)Version:
Description
Errors captured through
onunhandledrejection
mechanism never really provide any useful information that would help in figuring out the problem.In my app, I have thousands (17K as of now for one of them, after few months) of UnhandledRejection errors. All info that those events provide is just a an error text like
UnhandledRejection: "CustomEvent"
(note that with latest version of Sentry it became a little bit more informative withUnhandledRejection: Non-Error promise rejection captured with keys: isTrusted
text). There is no stack nor extra context and those errors happen on routes and paths that work perfectly for me and everyone I know so I'm unable figure out how to address them.Now, I assume, that the problem is only with unhandled promise rejections that reject with non-Error type like primitive values (string, null, etc.) or (like in this case) an Event object. While I don't see how to improve cases with primitive values, I think for event objects, more data could be logged.
It seems the
UnhandledRejection: Non-Error promise rejection captured with keys: isTrusted
message comes from the fact thatisTrusted
is the only iterable key on the event object (tryconsole.log(Object.keys(new CustomEvent('test')))
). But event objects have more useful (non-iterable) keys that could provide more information about the error. Namely I'm thinking aboutdetail
andtype
properties. I think those could help identifying from which code event is coming from.So I'm suggesting to add some custom code (if there isn't already) for handling that special case (unhandledrejection with event object) better.
Some example events:
https://sentry.io/share/issue/4d294f75e9704103b7c3b49e62b6e278/
https://sentry.io/share/issue/c36904ab4c224fbda6f1afff63c106ee/
(these are minimal, sharable versions but full events don't really provide any other meaningful information either.)
The text was updated successfully, but these errors were encountered: