Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

In the vite plugin, token has all permissions set, but the upload error 401,but the release is created #15425

Open
3 tasks done
hamono opened this issue Feb 15, 2025 · 1 comment

Comments

@hamono
Copy link

hamono commented Feb 15, 2025

Is there an existing issue for this?

How do you use Sentry?

Self-hosted/on-premise

Which SDK are you using?

@sentry/browser

SDK Version

2.22.7

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

This is the config code

sentryVitePlugin({
    url: "https://sentry-test.abc.cn/",
    org: "org",
    project: "talent-profile-web",
    release: {
      name: pak.version,
      uploadLegacySourcemaps: "dist",
    },
    authToken:
      "ac2474a04d54455399f1c73361070bd56c0d2166d66a47e7bfc3xxxxxx",
}),

And the picture is the token config, All permission is allowed:

Image

Steps to Reproduce

Now it not work, when run the build script, show follow error:

> Found 2 files
> Analyzing 2 sources
> Analyzing completed in 0.018s
> Adding source map references
> Bundling files for upload... 
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░  0/2 
> Found 2 files
> Analyzing 2 sources
> Analyzing completed in 0.012s
> Rewriting sources
> Bundling completed in 0.216s
> Bundled 2 files for upload
> Bundle ID: ca126c74-980f-5f9a-af69-7de10fc13073
> Optimizing completed in 0.01s
error: API request failed

Caused by:
    sentry reported an error: Invalid token (http status: 401)

Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
Please attach the full debug log to all bug reports.
[sentry-vite-plugin] Info: Successfully uploaded source maps to Sentry
> Bundling completed in 0.215s
> Bundled 2 files for upload
> Bundle ID: f085979d-313c-5a77-aabe-7c6f76e99707
> Optimizing completed in 0.01s
error: API request failed

Caused by:
    sentry reported an error: Invalid token (http status: 401)

Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
Please attach the full debug log to all bug reports.

But the release is created without any sourceMap files:

Image

Image

Expected Result

It can upload success .

Actual Result

It not work

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Feb 15, 2025
@github-actions github-actions bot added the Package: browser Issues related to the Sentry Browser SDK label Feb 15, 2025
@Lms24
Copy link
Member

Lms24 commented Feb 17, 2025

Hi!

SDK Version
2.22.7

Please update to the latest Vite plugin version and give it another try.

How do you use Sentry?
Self-hosted/on-premise

Are you using the latest self-hosted Sentry version (25.1.0 at this time)?

I generally recommend using org-based auth tokens as they were made specifically to support source maps upload and are valid across multiple projects within one organization.

Ultimately, since you're using self-hosted: Please check your Sentry logs. We haven't received similar reports on Sentry SaaS, so I suspect this is most likely a self-hosted issue.

@Lms24 Lms24 added Waiting for: Community and removed Package: browser Issues related to the Sentry Browser SDK labels Feb 17, 2025
@getsantry getsantry bot moved this to Waiting for: Community in GitHub Issues with 👀 3 Feb 17, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
Status: Waiting for: Community
Development

No branches or pull requests

2 participants