zeroclaw-labs/zeroclaw · error

Email OAuth2 device-code start failed ({status}): {body}

Error message

Email OAuth2 device-code start failed ({status}): {body}

What it means

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

Source

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

    client: &Client,
    device_code_url: &str,
    client_id: &str,
    scopes: &[String],
) -> Result<DeviceCodeStart> {
    let scope_str = scopes.join(" ");
    let form: &[(&str, &str)] = &[("client_id", client_id), ("scope", &scope_str)];

    let response = client
        .post(device_code_url)
        .form(form)
        .send()
        .await
        .context("Failed to start email OAuth2 device-code flow")?;

    if !response.status().is_success() {
        let status = response.status();
        let body = response.text().await.unwrap_or_default();
        anyhow::bail!("Email OAuth2 device-code start failed ({status}): {body}");
    }

    let parsed: DeviceCodeResponse = response
        .json()
        .await
        .context("Failed to parse email OAuth2 device-code response")?;

    Ok(DeviceCodeStart {
        device_code: parsed.device_code,
        user_code: parsed.user_code,
        verification_uri: parsed.verification_uri,
        verification_uri_complete: parsed.verification_uri_complete,
        expires_in: parsed.expires_in,
        interval: parsed.interval.unwrap_or(5).max(1),
        message: parsed.message,
    })
}

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Check the returned status/body; verify the OAuth2 client ID and device-code endpoint configuration.

When it happens

Trigger: Thrown at crates/zeroclaw-providers/src/auth/email_oauth2.rs:99 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/9d58405eef777d38. Report an issue: GitHub.