BoundaryML/baml · error

Timed out after {} minutes waiting for the login to be confi

Error message

Timed out after {} minutes waiting for the login to be confirmed.

What it means

During `baml auth login` device flow, poll_token_endpoint polls the token endpoint until LOGIN_TIMEOUT elapses; if the login was never confirmed in the browser within that window, it bails with the timeout message (minutes are computed from LOGIN_TIMEOUT.as_secs() / 60). It means authorization_pending persisted until the deadline.

Source

Thrown at baml_language/crates/baml_cli/src/auth.rs:372

/// current interval, `slow_down` widens it by five seconds, and
/// `access_denied` / `expired_token` are terminal.
///
/// Errors:
/// - When the user denies the login, the code expires, an unrecognized
///   error is returned, or [`LOGIN_TIMEOUT`] elapses.
fn poll_token_endpoint(
    endpoint: &str,
    form: &[(&str, &str)],
    server_interval: Option<u64>,
) -> Result<TokenResponse> {
    let client = http_client();
    let deadline = std::time::Instant::now() + LOGIN_TIMEOUT;
    let mut interval = server_interval
        .map(Duration::from_secs)
        .unwrap_or(DEFAULT_POLL_INTERVAL);
    loop {
        if std::time::Instant::now() >= deadline {
            anyhow::bail!(
                "Timed out after {} minutes waiting for the login to be confirmed.",
                LOGIN_TIMEOUT.as_secs() / 60
            );
        }
        let resp = client
            .post(endpoint)
            .header("content-type", "application/x-www-form-urlencoded")
            .body(encode_form(form))
            .send()
            .context("Failed to reach the auth server")?;
        let status = resp.status();
        let value: serde_json::Value = resp
            .json()
            .context("Failed to parse token endpoint response")?;

        if status.is_success() {
            return serde_json::from_value(value).context("Failed to parse token response");
        }

View on GitHub (pinned to bd85ce9dee)

Solutions

  1. Re-run `baml auth login` and complete the browser confirmation promptly.
  2. Open the printed URL / enter the confirmation code as soon as it appears.
  3. Check network access to the auth server so the approval actually registers.
  4. If a custom polling interval was configured, remove it or shorten it below the timeout window.
Defensive patterns

Strategy: retry

Try / catch

match baml_cli::auth::device_login(...) {
    Err(e) if e.to_string().contains("Timed out") => {
        // prompt user, then retry once
        prompt("complete login in browser, retry?");
        baml_cli::auth::device_login(...)?;
    }
    r => r?,
}

Prevention

When it happens

Trigger: device_login -> poll_token_endpoint looping with `authorization_pending` responses past the deadline (Instant::now() >= deadline).

Common situations: User never opened the confirmation URL or closed the browser tab; user took too long; polling interval misconfigured (server_interval very large) so fewer polls fit in the window.

Understand the failure class

Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.

Related errors


AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12). Data as JSON: /api/errors/26be326ac41695e7. Report an issue: GitHub.