{"record":{"id":"7c78d0cdcc3b3949","repo":"zed-industries/zed","slug":"timed-out-connecting-to-cloud-websocket","errorCode":null,"errorMessage":"timed out connecting to Cloud WebSocket","messagePattern":"timed out connecting to Cloud WebSocket","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cloud_api_client/src/websocket/web.rs","lineNumber":73,"sourceCode":"        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":55,"sourceCodeEnd":80,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/cloud_api_client/src/websocket/web.rs#L55-L80","documentation":"The WebSocket connect future lost a race against the executor timer in CloudApiClient::connect: the handshake to Zed Cloud did not complete within the allotted timeout window, and the pending connect future was dropped.","triggerScenarios":"Thrown at crates/cloud_api_client/src/websocket/web.rs:73 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check for slow or lossy network conditions between client and the Zed Cloud endpoint","Retry the connection when the network improves","Investigate server-side latency if timeouts persist on a healthy connection"],"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-14T05:17:10.506Z"}