sentry-cli "Auth token is required for this request" in CI
sentry-cli checks for a token before making the call, and when neither SENTRY_AUTH_TOKEN, --auth-token, nor a config file provides one, it stops locally with "Auth token is required for this request." No network request is made.
What this error means
sentry-cli exits immediately with "error: Auth token is required for this request" - distinct from a 401, because the CLI never sent anything to the API.
error: Auth token is required for this request. Please use the `--auth-token` parameter or set the `SENTRY_AUTH_TOKEN` environment variable.Common causes
No token source is configured
The job has no SENTRY_AUTH_TOKEN, no --auth-token flag, and no .sentryclirc, so the CLI has nothing to authenticate with and refuses to proceed.
A wrapper action did not forward the token
A custom composite step calls sentry-cli without inheriting the env, so the token defined at the job level never reaches the binary.
How to fix it
Provide the token via env or flag
- Set
SENTRY_AUTH_TOKENin the env that runs sentry-cli. - Or pass
--auth-tokenexplicitly on the command. - Re-run; the CLI now has a token and proceeds to the API.
sentry-cli --auth-token "$SENTRY_AUTH_TOKEN" releases finalize "$GITHUB_SHA"Use a .sentryclirc for repeated calls
Write the token and org/project once so every sentry-cli invocation in the job picks it up.
[auth]
token=${SENTRY_AUTH_TOKEN}
[defaults]
org=my-org
project=my-projectHow to prevent it
- Define the token at the job level so all sentry-cli steps inherit it.
- Forward env explicitly when wrapping sentry-cli in composite actions.
- Keep org and project defaults in
.sentryclircto avoid per-call flags.