{"record":{"id":"aa64f095c75ab5d9","repo":"zed-industries/zed","slug":"failed-to-get-cloud-client","errorCode":null,"errorMessage":"Failed to get Cloud client","messagePattern":"Failed to get Cloud client","errorType":"error_code","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/client/src/user.rs","lineNumber":920,"sourceCode":"    }\n\n    fn handle_message_to_client(this: WeakEntity<Self>, message: &MessageToClient, cx: &App) {\n        match message {\n            MessageToClient::UserUpdated => {}\n            MessageToClient::NotificationsUpdated => return,\n        }\n\n        cx.spawn(async move |cx| {\n            let (cloud_client, system_id) = cx\n                .update(|cx| {\n                    this.read_with(cx, |this, _cx| {\n                        this.client.upgrade().map(|client| {\n                            let system_id = client.telemetry().system_id().map(|id| id.to_string());\n                            (client.cloud_client(), system_id)\n                        })\n                    })\n                })?\n                .ok_or(anyhow::anyhow!(\"Failed to get Cloud client\"))?;\n\n            let response = cloud_client.get_authenticated_user(system_id).await?;\n            cx.update(|cx| {\n                this.update(cx, |this, cx| {\n                    this.update_authenticated_user(response, cx);\n                })\n            })?;\n\n            anyhow::Ok(())\n        })\n        .detach_and_log_err(cx);\n    }\n\n    pub fn watch_current_user(&self) -> watch::Receiver<Option<Arc<User>>> {\n        self.current_user.clone()\n    }\n\n    fn load_users(","sourceCodeStart":902,"sourceCodeEnd":938,"githubUrl":"https://github.com/zed-industries/zed/blob/5a9b9558db01a6b906cec2fb70a797affdc58cdd/crates/client/src/user.rs#L902-L938","documentation":"In handle_message_to_client (UserUpdated event), the code tried to obtain the global cloud Client entity via an upgrade/lookup that returned None; the sentinel error means the client entity was not available at that point (not yet initialized or already torn down), so the user update could not be processed against the cloud client.","triggerScenarios":"Thrown at crates/client/src/user.rs:918 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry once the Client global has been initialized at startup","Defer handling user-updated messages until sign-in/cloud client setup completes","Drop the update gracefully if the client is gone during shutdown instead of erroring"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5a9b9558db01a6b906cec2fb70a797affdc58cdd","analyzedAt":"2026-09-05T10:33:00.413Z","contentChangedAt":"2026-09-05T10:33:00.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}