Skip to content
Latchkey

Dagger "DAGGER_CLOUD_TOKEN" missing / cloud auth in CI

Dagger Cloud captures traces when DAGGER_CLOUD_TOKEN is set in the job. If the token is missing or invalid, the run still builds but uploads nothing, and Dagger warns that cloud reporting was not authorized.

What this error means

The build works but no run appears in Dagger Cloud, and dagger warns "DAGGER_CLOUD_TOKEN is not set" or that cloud auth failed.

dagger
Warning: DAGGER_CLOUD_TOKEN is not set; cloud traces will not be uploaded
Error: dagger cloud: failed to authenticate: invalid token

Common causes

The token was never exported to the job

Cloud uploads read DAGGER_CLOUD_TOKEN from the environment. Without it set from a secret, nothing is uploaded.

An invalid or revoked token

A wrong or rotated token authenticates but is rejected, so cloud reporting fails.

How to fix it

Export the cloud token from a secret

  1. Store the Dagger Cloud token as a CI secret.
  2. Export DAGGER_CLOUD_TOKEN in the job environment.
  3. Re-run and confirm the trace appears in Dagger Cloud.
.github/workflows/ci.yml
env:
  DAGGER_CLOUD_TOKEN: ${{ secrets.DAGGER_CLOUD_TOKEN }}

Rotate an invalid token

If auth fails with a token present, generate a fresh Dagger Cloud token and update the secret.

How to prevent it

  • Set DAGGER_CLOUD_TOKEN as a CI secret for cloud traces.
  • Rotate the token and update the secret in one place.
  • Do not commit the token to the repository.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →