Skip to content
Latchkey

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.

sentry-cli
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

  1. Set SENTRY_AUTH_TOKEN in the env that runs sentry-cli.
  2. Or pass --auth-token explicitly on the command.
  3. Re-run; the CLI now has a token and proceeds to the API.
Terminal
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.

.sentryclirc
[auth]
token=${SENTRY_AUTH_TOKEN}
[defaults]
org=my-org
project=my-project

How 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 .sentryclirc to avoid per-call flags.

Frequently asked questions

What causes ""Auth token is required for this request""?
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.
How do I fix "Auth token is required for this request"?
Provide the token via env or flag

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card