zeroclaw-labs/zeroclaw · error

Email OAuth2 device-code polling failed ({status}): {text}

Error message

Email OAuth2 device-code polling failed ({status}): {text}

What it means

Error "Email OAuth2 device-code polling failed ({status}): {text}" thrown in zeroclaw-labs/zeroclaw.

Source

Thrown at crates/zeroclaw-providers/src/auth/email_oauth2.rs:171

        let text = response.text().await.unwrap_or_default();

        if let Ok(err) = serde_json::from_str::<OAuthErrorResponse>(&text) {
            match err.error.as_str() {
                "authorization_pending" => continue,
                "slow_down" => {
                    interval_secs = interval_secs.saturating_add(5);
                    continue;
                }
                "access_denied" => anyhow::bail!("Email OAuth2 authorization was denied"),
                "expired_token" => anyhow::bail!("Email OAuth2 device-code expired"),
                _ => anyhow::bail!(
                    "Email OAuth2 device-code polling failed ({status}): {}",
                    err.error_description.unwrap_or(err.error)
                ),
            }
        }

        anyhow::bail!("Email OAuth2 device-code polling failed ({status}): {text}");
    }
}

async fn parse_token_response(response: reqwest::Response) -> Result<TokenSet> {
    if !response.status().is_success() {
        let status = response.status();
        let body = response.text().await.unwrap_or_default();
        anyhow::bail!("Email OAuth2 token request failed ({status}): {body}");
    }

    let token: TokenResponse = response
        .json()
        .await
        .context("Failed to parse email OAuth2 token response")?;

    let expires_at = token.expires_in.and_then(|seconds| {
        if seconds <= 0 {
            None

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Check the polling response body for the OAuth error code and correct the client configuration.

When it happens

Trigger: Thrown at crates/zeroclaw-providers/src/auth/email_oauth2.rs:171 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/0f3daa265a900b10. Report an issue: GitHub.