atuinsh/atuin · info

authentication canceled

Error message

authentication canceled

What it means

During `atuin ai` inline setup, `ensure_hub_session` prompts the user to press enter to begin Hub authentication. If the user presses esc (or otherwise declines), the function bails with this message instead of starting authentication.

Source

Thrown at crates/atuin-ai/src/commands/inline.rs:125

    let hub_address = settings.hub_endpoint();
    let will_sync = settings.is_hub_sync();

    info!("No Hub session found, prompting for authentication");

    println!("Atuin AI requires authenticating with Atuin Hub.");
    if will_sync {
        println!(
            "Once logged in, your shell history will be synchronized via Atuin Hub if auto_sync \
             is enabled or when manually syncing."
        );
    }
    println!(
        "If you have an existing Atuin sync account, you can log in with your existing \
         credentials."
    );
    println!("Press enter to begin (or esc to cancel).");
    if !wait_for_login_confirmation()? {
        bail!("authentication canceled");
    }

    debug!("Starting Atuin Hub authentication...");
    println!("Authenticating with Atuin Hub...");

    let session = atuin_client::hub::HubAuthSession::start(&hub_address).await?;
    println!("Open this URL to continue:");
    println!("{}", session.auth_url);

    let token = session
        .wait_for_completion(
            atuin_client::hub::DEFAULT_AUTH_TIMEOUT,
            atuin_client::hub::DEFAULT_POLL_INTERVAL,
        )
        .await?;

    info!("Authentication complete, saving session token");
    atuin_client::hub::save_session(&token).await?;

View on GitHub (pinned to c0c717ab04)

Solutions

  1. Re-run the command and press Enter instead of esc at the confirmation prompt
  2. Ensure the terminal is interactive (TTY) so the prompt can be answered
  3. Set up Hub authentication beforehand so the prompt is skipped
Defensive patterns

Strategy: try-catch

Validate before calling

// only prompt when a TTY is available
let interactive = std::io::stdin().is_terminal();

Try / catch

match ensure_hub_session().await {
    Ok(session) => run_with(session),
    Err(e) if e.to_string().contains("authentication canceled") => return Ok(()), // user opted out
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Pressing esc (or any key `wait_for_login_confirmation` treats as cancel) at the 'Press enter to begin (or esc to cancel)' prompt during AI inline command setup

Common situations: User changes their mind mid setup, presses esc accidentally, or runs the command non-interactively where the confirmation read aborts

Understand the failure class

Related errors


AI-assisted analysis of atuinsh/atuin@c0c717ab04 (2026-09-12). Data as JSON: /api/errors/f9b83e124afbf662. Report an issue: GitHub.