Skip to main content
When a command requires authentication and none is available, the CLI detects the error and—if running in an interactive terminal—offers to start the login flow automatically. If you decline, or if the session is non-interactive, the command exits non-zero with guidance on how to authenticate.

TokenNotFoundError


Cause
The CLI attempted to load an authentication token from the keyring for the target site, but no token was found. This typically occurs when you have not yet logged in, or when a previous anaconda auth logout removed the stored credentials. In an interactive terminal, the CLI prompts with “Continue with interactive login?” before failing.

Solution
Run anaconda auth login to authenticate and store a new token:
anaconda auth login
For non-interactive environments (CI/CD pipelines, scripts), set the ANACONDA_AUTH_API_KEY environment variable instead:
export ANACONDA_AUTH_API_KEY=your-api-key

TokenExpiredError


Cause
A token was found in the keyring, but it has expired. API keys have a configurable expiration period, and the CLI validates the token before making requests. In an interactive terminal, the CLI prompts with “Continue with interactive login?” to replace the expired token.

Solution
Run anaconda auth login to issue and store a fresh token:
anaconda auth login
To configure the expiration period for new tokens, see the api_key_expiration_days setting in Configuration.

AuthenticationMissingError


Cause
A request was made to a server endpoint that requires authentication, but no credentials were attached to the request. This can happen when a command reaches an authenticated API without first loading a token from the keyring or environment. In an interactive terminal, the CLI offers to start the login flow automatically.

Solution
Log in to store credentials for the target site:
anaconda auth login
Alternatively, set the ANACONDA_AUTH_API_KEY environment variable:
export ANACONDA_AUTH_API_KEY=your-api-key

InvalidAuthentication


Cause
Credentials were sent with the request, but the server rejected them. This usually means the stored API key has been revoked, rotated on the server side, or was issued for a different site. In an interactive terminal, the CLI offers to start the login flow to obtain a replacement token.

Solution
Force a new login to replace the invalid credentials:
anaconda auth login --force
If you are targeting a specific site, include the --at flag:
anaconda auth login --force --at <SITE>