warpdotdev/warp · error · anyhow::Error

Error polling OAuth status: {err}

Error message

Error polling OAuth status: {err}

What it means

Wrapper around the underlying error returned by `poll_oauth_until_terminal` while polling the OAuth transaction after an integration create/update returned (auth_url, tx_id). The {err} suffix carries the real cause — network failure, HTTP/GraphQL error from the integrations client, or an auth problem — and the app force-terminates with it.

Source

Thrown at app/src/ai/agent_sdk/integration.rs:328

                                            }
                                            Ok(OauthConnectTxStatus::Expired) => {
                                                ctx.terminate_app(
                                                    TerminationMode::ForceTerminate,
                                                    Some(Err(anyhow::anyhow!("OAuth authorization expired."))),
                                                );
                                            }
                                            Ok(OauthConnectTxStatus::Pending)
                                            | Ok(OauthConnectTxStatus::InProgress) => {
                                                // Should not be returned by poll_oauth_until_terminal.
                                                ctx.terminate_app(
                                                    TerminationMode::ForceTerminate,
                                                    Some(Err(anyhow::anyhow!("Unexpected non-terminal OAuth status returned"))),
                                                );
                                            }
                                            Err(err) => {
                                                ctx.terminate_app(
                                                    TerminationMode::ForceTerminate,
                                                    Some(Err(anyhow::anyhow!("Error polling OAuth status: {err}"))),
                                                );
                                            }
                                        }
                                    },
                                );
                            }
                            (Some(auth_url), None) => {
                                println!("Authorize the provider here: {auth_url}\n");
                                ctx.open_url(&auth_url);
                                println!(
                                    "After authorizing, re-run the command to continue the integration {action} process.",
                                );
                                ctx.terminate_app(
                                    TerminationMode::ForceTerminate,
                                    None,
                                );
                            }
                            (None, Some(_)) => {

View on GitHub (pinned to e72fd7aacb)

Solutions

  1. Read the {err} text — it names the actual transport or auth cause.
  2. Verify connectivity to SERVER_ROOT_URL (e.g. curl) and re-run the command; OAuth state is server-side and the flow restarts cleanly.
  3. If err mentions 401/403 or auth, re-run login then retry the integration command.
  4. For self-hosted warp-server, check its logs and whether the transaction expired server-side.
Defensive patterns

Strategy: retry

Validate before calling

// Before starting the flow, cheap reachability check:
let client = ServerApiProvider::as_ref(ctx).get_integrations_client();
if let Err(e) = client.ping().await {
    eprintln!("server unreachable, aborting before OAuth flow: {e}");
    return;
}

Try / catch

Match the poll Result; for Err messages indicating transport failure (timeout, connection reset), re-spawn poll_oauth_until_terminal with bounded retry/backoff instead of terminate_app; terminate only on auth errors or exhausted retries.

Prevention

When it happens

Trigger: During `integration create/update`, after the browser is opened for authorization, the polling future returns Err: connection reset or timeout mid-poll, 401/403 from the integrations client, a GraphQL transport failure, or the server dropping the transaction.

Common situations: Offline or proxied environments that cut long polling requests; login credentials expiring mid-flow; a self-hosted warp-server restarting and losing the transaction; VPN/DNS flakiness while the poll loop runs.

Related errors


AI-assisted analysis of warpdotdev/warp@e72fd7aacb (2026-08-16). Data as JSON: /api/errors/c90fa1365e5d51a7. Report an issue: GitHub.