zeroclaw-labs/zeroclaw · error · anyhow::Error
ms365: device code flow timed out waiting for user authoriza
Error message
ms365: device code flow timed out waiting for user authorization
What it means
Error "ms365: device code flow timed out waiting for user authorization" thrown in zeroclaw-labs/zeroclaw.
Source
Thrown at crates/zeroclaw-tools/src/microsoft365/auth.rs:288
let body = poll_resp.text().await.unwrap_or_default();
if body.contains("authorization_pending") {
continue;
}
if body.contains("slow_down") {
tokio::time::sleep(std::time::Duration::from_secs(5)).await;
continue;
}
::zeroclaw_log::record!(
DEBUG,
::zeroclaw_log::Event::new(module_path!(), ::zeroclaw_log::Action::Note)
.with_attrs(::serde_json::json!({"body": body})),
"ms365: device code polling raw error"
);
anyhow::bail!("ms365: device code polling failed");
}
anyhow::bail!("ms365: device code flow timed out waiting for user authorization")
}
async fn refresh_token(
&self,
client: &reqwest::Client,
refresh_token: &str,
) -> anyhow::Result<CachedTokenState> {
let token_url = format!(
"https://login.microsoftonline.com/{}/oauth2/v2.0/token",
self.config.tenant_id
);
let mut params = vec![
("grant_type", "refresh_token"),
("client_id", self.config.client_id.as_str()),
("refresh_token", refresh_token),
];
View on GitHub (pinned to 88bb9c8533)
Solutions
- Complete device-code authorization before the timeout; restart the flow if needed.
When it happens
Trigger: Thrown at crates/zeroclaw-tools/src/microsoft365/auth.rs:288 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23).
Data as JSON: /api/errors/4c33e68504ec2a3f.
Report an issue: GitHub.