Skip to content

sentry-cli sourcemaps upload returns 401 "Invalid org token" for EU-region orgs #3385

Description

@janonymus

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

  1. Have a Sentry organization on the EU data region (de.sentry.io).

  2. Create an Organization Auth Token

  3. Configure the environment as documented:
    SENTRY_AUTH_TOKEN=
    SENTRY_URL=https://de.sentry.io
    SENTRY_ORG=
    SENTRY_PROJECT=

  4. Run a source-map upload, e.g.:
    sentry-cli sourcemaps upload --release ./dist

  5. Observe the upload fail with:
    error: API request failed
    caused by: sentry reported an error: Invalid org token (http status: 401)

Expected Result

Expected:
sentry-cli uploads to de.sentry.io, the host given by SENTRY_URL

Actual Result

Actual:
401 Invalid org token. The EU organization token embeds sentry.io (the US host) inside the token, and sentry-cli trusts that embedded host over the explicit SENTRY_URL, so the request hits the wrong region and is rejected. There is no flag to override it.

My Workaround that i use now:
Using a Personal auth token instead of an Organization token; it honors SENTRY_URL and uploads to de.sentry.io correctly. (SENTRY_URL must remain set.)

Time wise this happend around:
( CEST +2) 2026-07-20 18:00 - 21:00 till i figured out the workaround

Product Area

APIs

Link

No response

DSN

https://22b8b8c6e2d89f013bb3dd6ad25616b8@o4511768297078784.ingest.de.sentry.io/4511768313987152

Version

sentry-cli 3.6.1

Metadata

Metadata

Projects

Status
Waiting for: Product Owner

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions