{"record":{"id":"f027d3e2209244e7","repo":"Kuberwastaken/claurst","slug":"refresh-request-failed","errorCode":null,"errorMessage":"refresh: request failed: {}","messagePattern":"refresh: request failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-rust/crates/mcp/src/oauth.rs","lineNumber":539,"sourceCode":"/// Refresh an existing MCP token using the stored refresh token.\npub async fn refresh_mcp_token(server_name: &str, token_endpoint: &str) -> anyhow::Result<McpToken> {\n    let existing = get_mcp_token(server_name)\n        .ok_or_else(|| anyhow::anyhow!(\"No stored token for {}\", server_name))?;\n    let refresh = existing\n        .refresh_token\n        .as_deref()\n        .ok_or_else(|| anyhow::anyhow!(\"Token for {} has no refresh token\", server_name))?\n        .to_string();\n\n    let client = reqwest::Client::new();\n    let params = [(\"grant_type\", \"refresh_token\"), (\"refresh_token\", refresh.as_str())];\n\n    let resp = client\n        .post(token_endpoint)\n        .form(&params)\n        .send()\n        .await\n        .map_err(|e| anyhow::anyhow!(\"refresh: request failed: {}\", e))?;\n\n    if !resp.status().is_success() {\n        let status = resp.status();\n        let body = resp.text().await.unwrap_or_default();\n        anyhow::bail!(\"refresh: HTTP {} — {}\", status, body);\n    }\n\n    #[derive(serde::Deserialize)]\n    struct TokenResponse {\n        access_token: String,\n        refresh_token: Option<String>,\n        expires_in: Option<u64>,\n    }\n\n    let tr: TokenResponse = resp.json().await?;\n    let expires_at = tr.expires_in.map(|s| {\n        std::time::SystemTime::now()\n            .duration_since(std::time::UNIX_EPOCH)","sourceCodeStart":521,"sourceCodeEnd":557,"githubUrl":"https://github.com/Kuberwastaken/claurst/blob/b0637c97ec34144387cbf2f74f65df6d16a6cef1/src-rust/crates/mcp/src/oauth.rs#L521-L557","documentation":"The HTTP POST for the refresh_token grant failed at the transport level — connection error, DNS failure, TLS problem, or timeout while contacting the token endpoint. No HTTP response was received; the network request itself failed.","triggerScenarios":"Thrown at src-rust/crates/mcp/src/oauth.rs:539 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check connectivity to the token endpoint host","Inspect proxy/TLS settings for the authorization server","Retry once the network issue is resolved"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b0637c97ec34144387cbf2f74f65df6d16a6cef1","analyzedAt":"2026-09-10T00:24:58.650Z","contentChangedAt":"2026-09-10T00:24:58.650Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}