Skip to main content

login was cancelled in the browser

Error: login was cancelled in the browser

Variants of the message:

Error: timed out waiting for browser confirmation
Error: login was cancelled

tuna login prints this error and exits. No session is saved, and the previous login on the device stays as it was.

Causeโ€‹

tuna login opens a confirmation page in the browser and waits for a response. The login didn't complete:

  • login was cancelled in the browser โ€” someone clicked cancel on the confirmation page;
  • timed out waiting for browser confirmation โ€” the login wasn't confirmed in time: in the browser flow, the CLI waits 5 minutes, and the link for confirming from another device (--no-browser) is valid for a limited time;
  • login was cancelled โ€” the login was interrupted before confirmation.

A common cause of the timeout is logging in over SSH. The browser confirms the login by redirecting to 127.0.0.1 on the machine where the browser runs, and that redirect never reaches the server. In an SSH session, the CLI warns about this:

WARN[12:00:00] This looks like an SSH session: the browser must run on this machine to finish the login, use `tuna login --no-browser` to confirm it from another device

What to doโ€‹

  1. Run tuna login again and confirm the login within 5 minutes.

  2. Make sure the browser has the dashboard of the right account open.

  3. On a server you reached over SSH, log in with a link:

    tuna login --no-browser

    The CLI shows a link and a code. Open the link on any device where you're signed in to the dashboard and check that the code on the page matches.

  4. If there's nowhere to confirm the login in a browser, use an API key: tuna login --with-api-key.

See Sessions and API keys for details.