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

Unable to filter safari extensions #3313

Closed
5 of 9 tasks
senky opened this issue Mar 8, 2021 · 25 comments · Fixed by #3374 or #3929
Closed
5 of 9 tasks

Unable to filter safari extensions #3313

senky opened this issue Mar 8, 2021 · 25 comments · Fixed by #3374 or #3929

Comments

@senky
Copy link

senky commented Mar 8, 2021

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

6.2.0

Description

Chrome extensions are easy to filter out:

denyUrls: [/^chrome-extension:\/\//i]

But when I try it with safari extensions, sentry doesn't filter it out:

denyUrls: [/safari-(web-)?extension:/]

I even tried with ignoreErrors:

ignoreErrors: [/safari-(web-)?extension:/]

but to no avail. That is extremely weird, because I thought ignoreErrors checks for match in raw error string, which 100% contains safari-extension:or safari-web-extension:. See example:

Error: {}
at ClipperError@safari-extension:(//3284871F-A480-4FFC-8BC4-3F362C752446/2665fee0/commons.js:223036:10)
at fromAny@safari-extension:(//3284871F-A480-4FFC-8BC4-3F362C752446/2665fee0/commons.js:223078:28)
at _handleResponsePromise@safari-extension:(//3284871F-A480-4FFC-8BC4-3F362C752446/2665fee0/commons.js:202805:51)
at _handleDispatchResponse@safari-extension:(//3284871F-A480-4FFC-8BC4-3F362C752446/2665fee0/commons.js:202784:32)
at _handleMessage@safari-extension:(//3284871F-A480-4FFC-8BC4-3F362C752446/2665fee0/commons.js:202766:37)
at safari-extension:(//3284871F-A480-4FFC-8BC4-3F362C752446/2665fee0/commons.js:202755:26)
at emit@safari-extension:(//3284871F-A480-4FFC-8BC4-3F362C752446/2665fee0/topee-content.js:3507:17)
at safari-extension:(//3284871F-A480-4FFC-8BC4-3F362C752446/2665fee0/topee-content.js:3313:26)

Am I doing sometihing wrong? Is there a way to filter safari extensions out?

@LouisTrezzini
Copy link

We are facing the same issue

@senky
Copy link
Author

senky commented Mar 31, 2021

Friendly bump. :)

@kamilogorek
Copy link
Contributor

Browser extensions can be filtered directly in the UI (which also saves your event quota), so there's no need to change SDK config :)

image

@senky
Copy link
Author

senky commented Apr 5, 2021

I have it turned on, yet I still can see the errors like the one above still coming in.

@kamilogorek
Copy link
Contributor

@senky can you link one of the events that came through? I'll take a look.

@senky
Copy link
Author

senky commented Apr 6, 2021

Sure: https://tinyurl.com/2fj43c9t

@kamilogorek
Copy link
Contributor

@senky the fix is coming :)

@OMTI-Seyoon
Copy link

@senky the fix is coming :)
Hi, I have a question about this answer.
I faced a similar problem, how can I ignore safari-extension?
I want to ignore all errors caused by chrome-extension and safari-extension.
For your information, 'Filter out errors known to be caused by browser extensions' is turned on.

It's an error I got.

TypeError: undefined is not an object (evaluating 'g.toString')
at safari-extension:(//260B6E24-727B-43D5-ACB5-55C5A7B2EE46/4245c0c1/Honey.safariextension/h1-vendors-main-popover-wallet.js:51:75573)
at u@safari-extension:(//260B6E24-727B-43D5-ACB5-55C5A7B2EE46/4245c0c1/Honey.safariextension/h1-vendors-main-popover-wallet.js:147:37625)
at safari-extension:(//260B6E24-727B-43D5-ACB5-55C5A7B2EE46/4245c0c1/Honey.safariextension/h1-vendors-main-popover-wallet.js:147:37375)
at r@safari-extension:(//260B6E24-727B-43D5-ACB5-55C5A7B2EE46/4245c0c1/Honey.safariextension/h1-vendors-main-popover-wallet.js:51:77376)
at safari-extension:(//260B6E24-727B-43D5-ACB5-55C5A7B2EE46/4245c0c1/Honey.safariextension/h1-vendors-main-popover-wallet.js:51:77472)
at promiseReactionJob([native code])

@catchanuj
Copy link

can we pass in something like denyUrls: [/^chrome-extension:\/\//i, /safari-(web-)?extension:/],?

@kamilogorek
Copy link
Contributor

It should already filter these events correctly through the Sentry itself when you switch browser filtering on in your project settings.

@OMTI-Seyoon
Copy link

denyUrls: [/^chrome-extension:///i, /safari-(web-)?extension:/]
Are you saying that I just need to add this?

@kamilogorek
Copy link
Contributor

No, you need to do this only: #3313 (comment)

@OMTI-Seyoon
Copy link

That setting is already done. However, I received this error.

TypeError: undefined is not an object (evaluating 'g.toString')
at safari-extension:(//260B6E24-727B-43D5-ACB5-55C5A7B2EE46/4245c0c1/Honey.safariextension/h1-vendors-main-popover-wallet.js:51:75573)
at u@safari-extension:(//260B6E24-727B-43D5-ACB5-55C5A7B2EE46/4245c0c1/Honey.safariextension/h1-vendors-main-popover-wallet.js:147:37625)
at safari-extension:(//260B6E24-727B-43D5-ACB5-55C5A7B2EE46/4245c0c1/Honey.safariextension/h1-vendors-main-popover-wallet.js:147:37375)
at r@safari-extension:(//260B6E24-727B-43D5-ACB5-55C5A7B2EE46/4245c0c1/Honey.safariextension/h1-vendors-main-popover-wallet.js:51:77376)
at safari-extension:(//260B6E24-727B-43D5-ACB5-55C5A7B2EE46/4245c0c1/Honey.safariextension/h1-vendors-main-popover-wallet.js:51:77472)
at promiseReactionJob([native code])

@frigus02
Copy link

We're seeing exactly the same error. The setting "Filter out errors known to be caused by browser extensions" is turned on for the project.

TypeError: undefined is not an object (evaluating 'g.toString')
  at safari-extension:(//7A1512FB-B7BE-4E38-81F0-F53382838EC8/bb7332f4/Honey.safariextension/h1-vendors-main-popover-wallet.js:51:75573)
  at u@safari-extension:(//7A1512FB-B7BE-4E38-81F0-F53382838EC8/bb7332f4/Honey.safariextension/h1-vendors-main-popover-wallet.js:147:37625)
  at safari-extension:(//7A1512FB-B7BE-4E38-81F0-F53382838EC8/bb7332f4/Honey.safariextension/h1-vendors-main-popover-wallet.js:147:37375)
  at r@safari-extension:(//7A1512FB-B7BE-4E38-81F0-F53382838EC8/bb7332f4/Honey.safariextension/h1-vendors-main-popover-wallet.js:51:77376)
  at safari-extension:(//7A1512FB-B7BE-4E38-81F0-F53382838EC8/bb7332f4/Honey.safariextension/h1-vendors-main-popover-wallet.js:51:77472)
  at promiseReactionJob([native code])

@kamilogorek
Copy link
Contributor

I just verified it locally, and the filtering works as expected using the lastest SDK and Sentry SaaS. Please provide a link to the events that should be filtered, but were not.

@frigus02
Copy link

Sorry, I should have shared a link already. And thanks for the quick response. I think our SDK is mostly up to date (6.4.1). Here is a link to an event. It happened 6 times on what looks like the same device:

https://sentry.io/organizations/bolinda/issues/2415511757/?project=1369486

@kamilogorek
Copy link
Contributor

Thanks, that's helpful. Apparently the raw stack looks slightly differently, and SDK was not able to parse it correctly, which makes the filename and abs_path values malformed (abs_path is used for this filtering).
However, to tell what went wrong, we need the raw stack in the first place. And to obtain it, we need to attach it to the event.

Could you use the snippet below to configure your SDK and get back to me once you notice the same issue again? This time it should have additional data attached.

Sentry.init({
  beforeSend(event, hint) {
    try {
      if (hint.originalException.message === `undefined is not an object (evaluating 'g.toString')`) {
        event.extra = event.extra || {};
        event.extra.rawStack = hint.originalException.stack;
      }
    } catch (e) {
      return event;
    }

    return event;
  },
});

@frigus02
Copy link

Yes, will do. I'll get back to you when we see the event again.

@trmpowell
Copy link

Hi, @kamilogorek. We are seeing a similar error coming from a safari web extension. We are on the latest Sentry SDK and have "Filter out errors known to be caused by browser extensions" enabled. Suggestions?
https://sentry.io/organizations/mentorloop/issues/2508936522/

@kamilogorek
Copy link
Contributor

@trmpowell please see the comment above #3313 (comment)

Although in your case it would be message === "undefined is not an object (evaluating 'e.findEntry')".

@trmpowell
Copy link

@kamilogorek, we just got this one after adding the code snippet you requested:
https://sentry.io/organizations/mentorloop/issues/2580341834/

@trmpowell
Copy link

@kamilogorek
Copy link
Contributor

Thanks @trmpowell! #3929 should fix it soon.

@trmpowell
Copy link

@kamilogorek, can you confirm which SDK version this should be fixed in? We are on 6.12.0 and just got another safari-web-extension error:
https://sentry.io/organizations/mentorloop/issues/2672798627/

@trmpowell
Copy link

Ah, it looks like your PR went in after 6.12.0. We will upgrade. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants