{"record":{"id":"7d6c84ec8f3c5a42","repo":"zed-industries/zed","slug":"failed-to-get-authenticated-user-status-bod","errorCode":null,"errorMessage":"Failed to get authenticated user.\nStatus: {:?}\nBody: {body}","messagePattern":"Failed to get authenticated user\\.\nStatus: (.+?)\nBody: (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cloud_api_client/src/cloud_api_client.rs","lineNumber":264,"sourceCode":"            ),\n            AsyncBody::default(),\n            Some(&Credentials {\n                user_id,\n                access_token: access_token.into(),\n            }),\n        )?;\n\n        let mut response = self.http_client.send(request).await?;\n\n        if response.status().is_success() {\n            Ok(true)\n        } else {\n            let mut body = String::new();\n            response.body_mut().read_to_string(&mut body).await?;\n            if response.status() == StatusCode::UNAUTHORIZED {\n                Ok(false)\n            } else {\n                Err(anyhow!(\n                    \"Failed to get authenticated user.\\nStatus: {:?}\\nBody: {body}\",\n                    response.status()\n                ))\n            }\n        }\n    }\n\n    pub async fn submit_agent_feedback(&self, body: SubmitAgentThreadFeedbackBody) -> Result<()> {\n        let request = Request::builder().method(Method::POST).uri(\n            self.http_client\n                .build_zed_cloud_url(\"/client/feedback/agent_thread\")?\n                .as_ref(),\n        );\n\n        self.send_authenticated_request(request, AsyncBody::from(serde_json::to_string(&body)?))\n            .await?;\n        Ok(())\n    }","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/cloud_api_client/src/cloud_api_client.rs#L246-L282","documentation":"The authenticated-user check treats 2xx as authenticated and 401 as not authenticated; every other status is an error that includes the status and body. It indicates the cloud API answered abnormally (5xx, gateway error, malformed request) rather than a definitive auth verdict.","triggerScenarios":"GET on the authenticated-user endpoint returns something other than 2xx/401: server-side 5xx, 502/504 from a load balancer, or a 400 caused by malformed credentials headers.","commonSituations":"Cloud API incidents; environments with an intercepting proxy that mangles requests; corrupted stored credentials producing non-standard responses.","solutions":["Retry after a short wait — transient 5xx values are the most common cause","Check https://status.zed.dev for incidents","If persistent, inspect the body in the error and try signing out and back in to refresh credentials"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"let response = self.http_client.send(request).await?;\nlet status = response.status();\nif status.is_server_error() {\n    // transient cloud-side failure: safe to retry with backoff\n    backoff.wait().await;\n    return self.authenticated_user().await;\n}\nif !status.is_success() && status != StatusCode::UNAUTHORIZED {\n    anyhow::bail!(\"Failed to get authenticated user.\\nStatus: {status:?}\\nBody: {body}\");\n}","preventionTips":["Retry 5xx with exponential backoff; never retry 401 as an error path","Watch status.zed.dev during incident windows","Log the response body — it carries the server's explanation"],"tags":["api","http","cloud","auth"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}