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

Events missing debug ID #11865

Open
3 tasks done
InterstellarStella opened this issue May 2, 2024 · 4 comments
Open
3 tasks done

Events missing debug ID #11865

InterstellarStella opened this issue May 2, 2024 · 4 comments
Labels

Comments

@InterstellarStella
Copy link

InterstellarStella commented May 2, 2024

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

7.108.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup

Provided in the shadow ticket. Note that they are using wp-sentry.

Steps to Reproduce

  1. develop locally with webpack in development mode with webpack --watch --mode development (which, as opposed to what the documentation says, it still uploads the source maps to Sentry, although it shouldn't)
  2. The dist files generated by webpack locally in dev mode are gitignored, and are not uploaded to GitHub or the server. They are just for the user to preview locally.
  3. commit and push the source files to GitHub
  4. start the pipeline on Buddy.works, which
    1. pulls the source files from GitHub
    2. and then runs webpack --mode production to generate the dist files.
    3. It will then upload the generated _dist files to the server

Expected Result

Events are source mapped correctly.

Actual Result

After looking through how the rest of their events appear in Sentry, it looks like they are most likely generating and uploading source maps correctly. According to their logs, their source maps have debug IDs, and I am able to find them in their project settings too. However, their events do not have debug IDs, which is where things go wrong.

Since we do not have debug IDs available, we would fall back to the legacy source mapping method which uses releases, however, their source maps are not connected to their releases, so it's not possible to show readable code. Even if they were, though, the fact that their abs_path values in an event are not an exact match to the names of their uploaded files (there is a ver parameter appended at the end of the file name that does no exist in the uploaded source maps) would prevent Sentry from deminifying their stack traces still.

For a specific file, it is also unusual to see row 1 column 0, as it would most likely map to nothing even in working source maps.

So there are 2 issues to address here:
Why are there no debug IDs in your events
Why is that specific bundle showing row 1 column 0

┆Issue is synchronized with this Jira Improvement by Unito

@Lms24
Copy link
Member

Lms24 commented May 16, 2024

Hi,

Why are there no debug IDs in your events

I think this is the core question. Given wp-sentry isn't officially maintained by us I'm gonna tag @stayallive - do you have an idea why the browser SDK might not be attaching debug ids in wp-sentry? The relevant code is here. I just skimmed over wp-sentry and it seems it uses the browser SDK >7.47.0, so it should work 🤔

@Lms24
Copy link
Member

Lms24 commented May 16, 2024

Also, to folks following this issue: Can you confirm that no errors sent from the browser SDK have debug ids? (Sorry if I missed this in the various tickets and threads around this issue)

@stayallive
Copy link

Could this be a path mapping issue? I'm assuming OP develops a plugin or theme and they might not be in the path where Sentry would expect it to match uploaded sourcemaps.

There is no client config for this right? We have no special config set to disable anything as far as I'm aware, we bundle the CDN version of the builds and the latest plugin version bundles 7.112.2.

Anything I'm missing that would not client configuration to make this work?

@alessandro-newzoo
Copy link

TLDR: The problem seems to be gone on new issues concerning the same JS file. But, even though Sentry shows the correct line and content of the source file, the path it's showing is wrong and if I click on it, it gives me a 404.

Hi, I'm the person this issue was opened for 👋🏻

@stayallive you're right, I'm working on our website's theme, and the content of the folder wp-content/themes/newzoo/ is the only part tracked by git and uploaded to GitHub, but the path mapping should be correct as other files within the same folder were mapping correctly.

Before this issue was opened there's been a long discussion between me and Stella via tickets, so you're all probably lacking a lot of context here.

Basically I had this issue in Sentry where wp-content/themes/newzoo/js/_dist/single--games.bundle failed to be mapped to its source file wp-content/themes/newzoo/js/_src/single--games.js: https://newzoo-com.sentry.io/share/issue/f56fc05f6b964da38d075cc4b110158f/

Other issues concerning files in the same folder as the above were mapping correctly, eg: https://newzoo-com.sentry.io/share/issue/00f6add9b4064aa685640939fa69ae87/

Although I'm only noticing now something odd. The two issues above show different paths to the source:

The issue that doesn't map, shows
wp-content/themes/newzoo/js/_dist/single--games.bundle

The issue that maps correctly, shows
wp-content/themes/newzoo/js/_dist/newzoo/js/_src/single--trendreports

↑ this one, even though is the one that works, shows a wrong path to the source:

wp-content/themes/newzoo/js/_dist/newzoo/js/_src/single--trendreports
                            ^^^^^^^^^^^^^^^^
                         this shouldn't be here

To sum it up,
the source files are at
wp-content/themes/newzoo/js/_src
the dist files at
wp-content/themes/newzoo/js/_dist
and Sentry thinks the source files are at
wp-content/themes/newzoo/js/_dist/newzoo/js/_src/

So ironically the one that did not work was the one with the correct mapping.
It's somehow appending part of the src path to the full dist path.

I suspect that's why that was happening, though I have no idea why since both files were generated by the same webpack config. Is this something onwp-sentry's end? Sentry's? Or something I need to fix?

Like I said above, I can see the correct content in the stack trace, but the path is not correct for some reason, so if I click on it I get a 404:

CleanShotX - Arc  16 05 2024 at 15-31-11 @2x
CleanShotX - Arc  16 05 2024 at 15-42-39

I went ahead and deleted all Code Mappings, recreated it by clicking on Set up Code Mapping on the issue screen, which then created a new wrong mapping again (which works at showing the src content, but 404s on click):

CleanShotX.-.Arc.16.05.2024.at.16-00-40.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Status: Waiting for: Product Owner
Development

No branches or pull requests

5 participants