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
- Re-run `baml auth login` and complete the browser confirmation promptly.
- Open the printed URL / enter the confirmation code as soon as it appears.
- Check network access to the auth server so the approval actually registers.
- 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
- Complete the browser confirmation immediately after starting login.
- Avoid leaving `baml auth login` idle for longer than the timeout.
- Confirm network reachability of the auth server first.
- Do not override the poll interval with values close to or above the timeout.
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.
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- Login was denied in the browser.
- the confirmation code expired before it was used; run `baml
- Auth server returned {status}: {value}
- failed to replace {} with {}: {}
- Auth server returned {status}: {body}
AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12).
Data as JSON: /api/errors/26be326ac41695e7.
Report an issue: GitHub.