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

Sourcemaps uploaded with Debug ID's are not being applied to events #61559

Open
masinette opened this issue Dec 11, 2023 · 28 comments
Open

Sourcemaps uploaded with Debug ID's are not being applied to events #61559

masinette opened this issue Dec 11, 2023 · 28 comments

Comments

@masinette
Copy link
Member

masinette commented Dec 11, 2023

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

  1. Sourcemaps w/ debug id's are being uploaded via Sentry CLI
  2. Corresponding Artifacts are uploaded (also including Debug ID's)

Expected Result

The debug ID's match and are applied to the event

Actual Result

There is no debug_meta on the event. The debug id is in the stacktrace, and the corresponding artifacts are uploaded, but they are not being applied to the event

Product Area

Issues - Source Maps

Link

No response

DSN

No response

Version

" @sentry /electron": "4.13.0", " @sentry /react": "7.73.0", " @sentry /cli": "2.21.2"

┆Issue is synchronized with this Jira Improvement by Unito

@getsantry
Copy link
Contributor

getsantry bot commented Dec 11, 2023

Assigning to @getsentry/support for routing ⏲️

@getsantry getsantry bot moved this to Waiting for: Support in GitHub Issues with 👀 Dec 11, 2023
@masinette masinette added the Sync: Jira Apply to auto-create a Jira shadow ticket label Dec 11, 2023
@getsantry
Copy link
Contributor

getsantry bot commented Dec 12, 2023

Routing to @getsentry/product-owners-issues-source-maps for triage ⏲️

@getsantry getsantry bot moved this from Waiting for: Support to Waiting for: Product Owner in GitHub Issues with 👀 Dec 12, 2023
@lforst
Copy link
Member

lforst commented Dec 13, 2023

Ideally we get reproduction here because I can't figure out how this seems to happen nor can I reproduce myself.

@wlyu2001
Copy link

wlyu2001 commented Dec 21, 2023

Hi @lforst, you don't need to reproduce it yourself, you can simply see the symptom here:

Here is an event where you can see debugId in the stack trace, which is grabbed from minified production code:

https://bending-spoons.sentry.io/issues/4723380359/?project=6370840&query=is%3Aunresolved&referrer=issue-stream&statsPeriod=1h&stream_index=0

And here is the corresponding event json, where there is no debug_meta

https://bending-spoons.sentry.io/api/0/projects/bending-spoons/en-ion/events/961d8caf59a94e08a28d557f5adbe3f9/json/

cc @danyf90 @marcocadei

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 2 Dec 21, 2023
@lforst
Copy link
Member

lforst commented Dec 21, 2023

@wlyu2001 Unfortunately I do need to reproduce this so I can fix the bug (if there is one).

@wlyu2001
Copy link

Hi @lforst, you mean this could be how the system works normally? I was told by the technical support otherwise. :)

Let me know how I can help you to reproduce it. 🙏

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 2 Dec 21, 2023
@lforst
Copy link
Member

lforst commented Dec 21, 2023

you mean this could be how the system works normally?

Generally no. Things should work.

Let me know how I can help you to reproduce it. 🙏

Ideally you create a very small app with all the relevant build steps in order to replicate the behaviour you're seeing in your app and Sentry instance. Thanks!

@wlyu2001
Copy link

wlyu2001 commented Dec 21, 2023

@lforst The situation as I understand is:

  • We have some js code in production, it has debugId (this means our CI processed the code correctly and uploaded the right bundle to production.)
  • Somewhere it crashes, and sentry sdk caught the crash. (this means our sentry integration is correct.)
  • Sentry sdk send the event json to the server, but missing debub_meta. (This part is where the problem lies, and we have no influence over this part.)
  • We can see the event in the console, but without source mapping, as a consequence of missing debub_meta.

Is there something wrong with this understanding?

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 2 Dec 21, 2023
@lforst
Copy link
Member

lforst commented Dec 21, 2023

The process you describe seems pretty standard. This is why a simple reproduction app would be needed to find out where stuff is buggy.

This part is where the problem lies, and we have no influence over this part

You do have influence over this part. You choose what is sent to Sentry - either via SDK configuration or via additional code.

We can see the event in the console, but without source mapping, as a consequence of missing debub_meta.

If you are referring to the browser console here, debug IDs will have no effect on browser dev tools source maps. (yet at least)

@wlyu2001
Copy link

@lforst

I got some typing error in

integrations: [new RewriteFrames()],

Type 'Integration & { name: string; processEvent(originalEvent: Event): Event; } & { setupOnce: (addGlobalEventProcessor?: ((callback: EventProcessor) => void) | undefined, getCurrentHub?: (() => Hub) | undefined) => void; }' is not assignable to type 'Integration'.
  Types of property 'setupOnce' are incompatible.
    Type '((addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub) => void) & ((addGlobalEventProcessor?: ((callback: EventProcessor) => void) | undefined, getCurrentHub?: (() => Hub) | undefined) => void)' is not assignable to type '(addGlobalEventProcessor: (callback: EventProcessor) => void, getCurrentHub: () => Hub) => void'.
      Types of parameters 'addGlobalEventProcessor' and 'addGlobalEventProcessor' are incompatible.
        Types of parameters 'callback' and 'callback' are incompatible.
          Type 'import("/Users/lingyu/evernote/desktop/node_modules/@sentry/integrations/node_modules/@sentry/types/types/eventprocessor").EventProcessor' is not assignable to type 'import("/Users/lingyu/evernote/desktop/node_modules/@sentry/types/types/eventprocessor").EventProcessor'.
            Types of parameters 'event' and 'event' are incompatible.
              Type 'import("/Users/lingyu/evernote/desktop/node_modules/@sentry/types/types/event").Event' is not assignable to type 'import("/Users/lingyu/evernote/desktop/node_modules/@sentry/integrations/node_modules/@sentry/types/types/event").Event'.
                Types of property 'spans' are incompatible.
                  Type 'import("/Users/lingyu/evernote/desktop/node_modules/@sentry/types/types/span").Span[] | undefined' is not assignable to type 'import("/Users/lingyu/evernote/desktop/node_modules/@sentry/integrations/node_modules/@sentry/types/types/span").Span[] | undefined'.
                    Type 'import("/Users/lingyu/evernote/desktop/node_modules/@sentry/types/types/span").Span[]' is not assignable to type 'import("/Users/lingyu/evernote/desktop/node_modules/@sentry/integrations/node_modules/@sentry/types/types/span").Span[]'.
                      Type 'Span' is missing the following properties from type 'Span': attributes, spanContext, end, setAttribute, and 3 more.ts(2322)

Here are our library versions

    "@sentry/electron": "^4.13.0",
    "@sentry/integrations": "^7.73.0",
    "@sentry/react": "^7.73.0",
    "@sentry/types": "^7.73.0",

What could be the problem? 🙏

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 2 Jan 24, 2024
@lforst
Copy link
Member

lforst commented Jan 24, 2024

Yes, please use the latest Sentry SDK version and use Sentry.rewriteFramesIntegration like I outlined in my comment. Thank you! We are deprecating a bunch of things in preparation for the new major version.

@wlyu2001
Copy link

@lforst After bumping to

    "@sentry/electron": "^4.17.0",
    "@sentry/react": "^7.92.0",
    "@sentry/types": "^7.92.0",

There are several errors with the init function. You can try with the code sample I sent you.

And I still can't find Sentry.rewriteFramesIntegration. Is there any documentation about this API change?

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 2 Jan 24, 2024
@lforst
Copy link
Member

lforst commented Jan 25, 2024

Ok, I am sorry for this mess. We are in the middle of a big refactoring and it seems like there are certain incompatibilities between the electron package and the main SDKs.

Can you try bumping the main SDKs to at least 7.97.0 and see if the type issues persist? Everything else should work as I explained.

And I still can't find Sentry.rewriteFramesIntegration. Is there any documentation about this API change?

This is very new API, however, it should have exactly the same API as RewriteFrames. We are more or less just converting the integration from a class to a function and renaming it. Docs will follow in one big sweep once we are done with the migration paths. We just don't want to tell you to use RewriteFrames right now, just so you have to change it again in a few weeks.

@wlyu2001
Copy link

Hi @lforst, I found the integration after sdk bump.

Question about the iteratee. In our case, the path for the stack frame is

app://evernote/boronConduitWorker/834-1e869c8c47b076b434cd.js

and the file in the release's artifacts is

~/renderer/boronConduitWorker/834-1e869c8c47b076b434cd.js

I can use iteratee as follows:

      iteratee(frame) {
        return {
          ...frame,
          filename: frame.filename?.replace('app://evernote/boronConduitWorker', '~/renderer/boronConduitWorker'),
        };
      },

Is this correct? 🙏

@lforst
Copy link
Member

lforst commented Feb 29, 2024

If your stackframe is
app://evernote/boronConduitWorker/834-1e869c8c47b076b434cd.js, the only thing you need to do for it to match with the artifact ~/renderer/boronConduitWorker/834-1e869c8c47b076b434cd.js is to transform the stacktrace so that it starts with app:/// (note the triple slash). ~ is a wildcard for any protocol. Meaning if you match the app:// part of the stack frame you currently get, by consuming the ~, you're left with evernote/boronConduitWorker/834-1e869c8c47b076b434cd.js which does not match /renderer/boronConduitWorker/834-1e869c8c47b076b434cd.js because it is missing a /.

Does that make sense?

@wlyu2001
Copy link

wlyu2001 commented Mar 1, 2024

It's not only the missing /, but the path also need to be transformed from /evernote/ to /renderer/, right?

I think i will use regex instead, to match any prefix with boronConduitWorker/ in it. I guess since ~ is a wildcard, I can remove it from the path, something like this?

          filename: frame.filename?.replace(
            /^.+boronConduitWorker\//,
            '/renderer/boronConduitWorker/'
          ),

🙏

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 2 Mar 1, 2024
@wlyu2001
Copy link

wlyu2001 commented Mar 1, 2024

BTW, the only frames we have problem with are those of boronConduitWorker, because during deployment we changed the path. So i would keep frames without boronConduitWorker untouched.

@lforst
Copy link
Member

lforst commented Mar 4, 2024

It's not only the missing /, but the path also need to be transformed from /evernote/ to /renderer/, right?

Correct! Sorry, I missed that!

BTW, the only frames we have problem with are those of boronConduitWorker, because during deployment we changed the path. So i would keep frames without boronConduitWorker untouched.

Sounds good.

I can remove it from the path, something like this?

Looks fine! I hope you understand though, that I cannot verify every single change you intend to make. We assume you (and all Sentry users) are capable engineers who will find the right solution for their setup!

@getsantry
Copy link
Contributor

getsantry bot commented Nov 23, 2024

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 🥀

@getsantry getsantry bot added the Stale label Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Status: No status
Status: Waiting for: Community
Development

No branches or pull requests

5 participants