{"record":{"id":"0cc37bbcdd86e180","repo":"zed-industries/zed","slug":"failed-to-connect-to-cloud-websocket-error","errorCode":null,"errorMessage":"failed to connect to Cloud WebSocket: {error}","messagePattern":"failed to connect to Cloud WebSocket: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cloud_api_client/src/websocket/web.rs","lineNumber":72,"sourceCode":"        let executor = cx.background_executor().clone();\n        Ok(cx.spawn(async move |_cx| {\n            let mut connect_url = client\n                .http_client\n                .build_zed_cloud_url(\"/client/users/connect\")?;\n            connect_url\n                .set_scheme(match connect_url.scheme() {\n                    \"https\" => \"wss\",\n                    \"http\" => \"ws\",\n                    scheme => return Err(anyhow!(\"invalid URL scheme: {scheme}\")),\n                })\n                .map_err(|_| anyhow!(\"failed to set URL scheme\"))?;\n\n\n            let connect = WebSocket::connect(connect_url).fuse();\n            let timeout = executor.timer(CONNECT_TIMEOUT).fuse();\n            futures::pin_mut!(connect, timeout);\n            let websocket = futures::select_biased! {\n                result = connect => result.map_err(|error| anyhow!(\"failed to connect to Cloud WebSocket: {error}\"))?,\n                _ = timeout => return Err(anyhow!(\"timed out connecting to Cloud WebSocket\")),\n            };\n\n            Ok(Connection::new(websocket))\n        }))\n    }\n}\n","sourceCodeStart":54,"sourceCodeEnd":80,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/cloud_api_client/src/websocket/web.rs#L54-L80","documentation":"Raised when the async WebSocket handshake to the Zed Cloud /client/users/connect endpoint fails (DNS failure, TCP refusal, TLS error, or HTTP upgrade rejection). The connect future itself errored before the timeout elapsed.","triggerScenarios":"Thrown at crates/cloud_api_client/src/websocket/web.rs:72 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify network connectivity and that the Zed Cloud service is reachable","Check authentication/credentials if the server rejects the upgrade request","Retry after transient network failures; the caller receives the task's Result and may re-invoke connect"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}