session expired or revoked, run tuna login
FATA[12:00:00] session expired or revoked, run `tuna login`
tuna CLI prints this error when it's signed in with a session (tuna login). At startup, the command exits right away. If the session ends while a tunnel is running, the CLI first warns:
WARN[12:00:00] Session expired or revoked, run `tuna login` to sign in again
The tunnel exits on the next reconnect with Failed to get connection settings: session expired or revoked, run `tuna login` . If the session was terminated in the profile, the device's tunnels stop immediately:
FATA[12:00:00] Login session was ended, run `tuna login` to sign in again
Causeโ
The server no longer accepts this device's session. This happens when:
- the device hasn't used the session for 30 days. A running tunnel extends the session by itself, so this is usually a machine where tuna hasn't run for a while;
- the session was terminated in the profile or with
tuna logout; - the session file or keyring entry was copied to another machine, and both machines refreshed the session. The server accepts each refresh token only once and treats reuse of an old one as a leak, so it terminates the whole session;
- you were removed from the team you signed in to.
The CLI deletes a dead session, so the next run may show Not logged in.
What to doโ
-
Log in again:
tuna loginOn a server without a browser, use
tuna login --no-browser. -
Restart the tunnels that exited.
-
If the session keeps ending, check the session list in your profile and in
tuna session list: one session may be in use on several machines. Log in on each machine separately. -
For servers, CI, and tunnels that must run unattended, use an API key or a background service: they don't need a session.
Learn more about sessions in Sessions and API keys.