Private Source Maps Not Working

Hi we are really struggling to get source maps working correctly in Sentry I feel like I’ve followed the instructions to the letter but they still aren’t working. Hopefully someone here can help.

  • We have a JS file https://assets.example.com/app-1.js where the last line reads //# sourceMappingURL=app-1.js.map
  • We are uploading assets to releases ahead of time via the rest API with name="~/app-1.js.map" the map file is 10.2mb we are also uploading the js file with name="~/app-1.js"
  • The map files are not publicly available.

This still doesn’t seem to work as I would have expected it to and I don’t see proper files/line numbers in Sentry.

Note: I also tried setting sourceMappingURL=~/app-1.js.map just in case that might work but it didn’t seem to make any difference

Any help would be hugely appreciated!

2 Likes

Are you certain the event you’re looking at is associated w/ the same release as the source/maps?

The ~ prefix basically says “ignore the domain”. So your original example seems to be correct.

You should be able to hover over the little (?) next to each frame to see where its looking for the sourcemap as well.

Thanks @zeeg

Yep, the release names line up (although I am using GIT SHAs and they get truncated in the web UI but the bit I can see look the same).

Question marks to see where it’s looking seem like they might be helpful but I can’t see any? Maybe that hints at another issue?

Ah so its not able to scrape your source at all here.

The problem is the filename is app-blahblahblah.js, and the releases mechanism will look for that exact filename. If you upload using the same pattern you’ll see everything magically fall into place.

so I am currently uploading as name="~/app-1.js" but I should use name="app-1.js" and keep the source maps as name="~/app-1.js.map"?

is that what you are suggesting?

If the value is literally ~/app-c3eaf76b66baedc7d145.js it should be fine. We basically look for (filename, release) in the local store, and we trim the domain if ~ is set. It’s possible there’s an issue with the tilde operator, but I’m not entirely sure what it could be.

Is this on sentry.io? If so do you mind dropping me a link to the issue?

Thanks @zeeg, I’ve sent an email to support@sentry.io with a link to the issue in Sentry.

Thanks! Will dig more, and update this (as well as the ticket) once we sort it out. It does appear as if something is wrong on our end in this situation, as at first glance everything is what I’d expect it to be.

Thanks a bunch for looking into it. Really glad it’s not me doing something stupid.

No rush, but we have a public launch on Wednesday :slight_smile:

Hi guys, any update on this issue? We are having this exact problem in our project, and it seems that we are uploading and naming artifacts the correct way. We can provide more information or open another thread if necessary.

Thanks!

Hi, sorry, I meant to provide an update here.

In our case it was due to us uploading gzipped assets. We fixed it by only uploading plain text js and maps.

I think there is a change deployed that means this should be flagged in the Sentry UI now though so maybe you are facing a different issue.

@aserrabl generally there should be some kind of error indicator showing if the sourcemap header or annotation is present. Are you not seeing anything? Its an expandable note at the top of the issue details.

Hey having the same problem :frowning:

Trying to upload sourcemaps for a node app that’s compiled with babel.

I tried:

  • Setting the --url-prefix to the exact location on my disk, so the filename.js.map in artifacts exactly matches the filename in the issue.
  • Inlining the sourcemaps

Here’s a link to the issue: https://sentry.io/stori/server/issues/169886162/

Here’s the sourceMappingURL
(New user so can’t upload images, putting the url to the images here)
/uploads/sentry/original/1X/9b93cd1316a19bbde8996595b8fbfd3894c05477.png

And client.js, client.js.map on the disk
/uploads/sentry/original/1X/8034447500f0f28241793181be451199c6113fd9.png

The issue in Sentry:
/uploads/sentry/original/1X/50b1706df8027f44b7217515566166a8912af105.png

And the artifacts with/without the url prefix:
/uploads/sentry/original/1X/ab1a328166a9fcd9d95393218449116e1f3169b9.png
/uploads/sentry/original/1X/057301eb4701adf3056aad4271c66d13464eac82.png

Kind of at a loss at what to do

@tuckerconnelly It’s probably worth noting that we do not support sourcemaps for Node. See: https://github.com/getsentry/sentry/issues/2632

Maybe this conversation should be archived?

Now sentry supports source maps for Node - so this thread is quite confusing if you ask me.

@zeeg @matt @dauledk @tuckerconnelly @andykent @aserrabl

I have like problem. can you help me?

  1. Raven Config
{ release: '1.0.0' }
  1. JS files

  1. release

  2. Issues

note:
(1) domain is like www.example.com
(2) http://www.example.com.app.fefsfsfsfswegbsmmds.js.map don’t get by http request.
(3) sentry server version is 8.11.0, private service.

last: when http://www.example.com.app.fefsfsfsfswegbsmmds.js.map can get by http request. Issues parse is ok.

this problem is sentry server version is 8.11.0 bug, 8.22.0 is ok.

Hi, I think it’s better to create a new thread for this.