{"record":{"id":"9d58405eef777d38","repo":"zeroclaw-labs/zeroclaw","slug":"email-oauth2-device-code-start-failed-status","errorCode":null,"errorMessage":"Email OAuth2 device-code start failed ({status}): {body}","messagePattern":"Email OAuth2 device-code start failed \\((.+?)\\): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-providers/src/auth/email_oauth2.rs","lineNumber":99,"sourceCode":"    client: &Client,\n    device_code_url: &str,\n    client_id: &str,\n    scopes: &[String],\n) -> Result<DeviceCodeStart> {\n    let scope_str = scopes.join(\" \");\n    let form: &[(&str, &str)] = &[(\"client_id\", client_id), (\"scope\", &scope_str)];\n\n    let response = client\n        .post(device_code_url)\n        .form(form)\n        .send()\n        .await\n        .context(\"Failed to start email OAuth2 device-code flow\")?;\n\n    if !response.status().is_success() {\n        let status = response.status();\n        let body = response.text().await.unwrap_or_default();\n        anyhow::bail!(\"Email OAuth2 device-code start failed ({status}): {body}\");\n    }\n\n    let parsed: DeviceCodeResponse = response\n        .json()\n        .await\n        .context(\"Failed to parse email OAuth2 device-code response\")?;\n\n    Ok(DeviceCodeStart {\n        device_code: parsed.device_code,\n        user_code: parsed.user_code,\n        verification_uri: parsed.verification_uri,\n        verification_uri_complete: parsed.verification_uri_complete,\n        expires_in: parsed.expires_in,\n        interval: parsed.interval.unwrap_or(5).max(1),\n        message: parsed.message,\n    })\n}\n","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-providers/src/auth/email_oauth2.rs#L81-L117","documentation":"Error \"Email OAuth2 device-code start failed ({status}): {body}\" thrown in zeroclaw-labs/zeroclaw.","triggerScenarios":"Thrown at crates/zeroclaw-providers/src/auth/email_oauth2.rs:99 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the returned status/body; verify the OAuth2 client ID and device-code endpoint configuration."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}