Skip to main content

Token expired

FATA[12:00:00] Token expired
Code: AuthorizationRequired
Request ID: 3e7d0b92a5f41c68d2e9b0a7f6c31d45

A variant of the message is Token deleted. If the key was deleted while the tunnel was running, the error appears on reconnect:

FATA[12:00:00] Failed to get connection settings: Token deleted
Code: Unauthorized
Request ID: b81c4f07e2d96a35c0f7e1b4a9d26083

tuna CLI and Tuna Desktop show this error. The client doesn't reconnect and exits right away. A background service logs the error with the note the token was revoked or does not exist, reinstall the service with a valid token and doesn't restart: restarting with the same key won't help.

Causeโ€‹

The server knows this API key but no longer accepts it:

  • Token expired โ€” the key's expiration date, set when it was created, has passed;
  • Token deleted โ€” the key was deleted in the dashboard or with tuna api-key delete. tuna service uninstall also deletes the service key.

What to doโ€‹

  1. Create a new API key with the Run tunnels permission.
  2. Replace the old key wherever it's stored: in CI secrets, the TUNA_API_KEY variable, or the config file via tuna login --with-api-key.
  3. If a background service shows the error, install it again: tuna service install issues a new key for the service. See Running in the background.
  4. Your own computer doesn't need a key: log in with tuna login.

Learn more about keys in Sessions and API keys.