zed-industries/zed · error

timed out connecting to Cloud WebSocket

Error message

timed out connecting to Cloud WebSocket

What it means

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.

Source

Thrown at crates/cloud_api_client/src/websocket/web.rs:73

        Ok(cx.spawn(async move |_cx| {
            let mut connect_url = client
                .http_client
                .build_zed_cloud_url("/client/users/connect")?;
            connect_url
                .set_scheme(match connect_url.scheme() {
                    "https" => "wss",
                    "http" => "ws",
                    scheme => return Err(anyhow!("invalid URL scheme: {scheme}")),
                })
                .map_err(|_| anyhow!("failed to set URL scheme"))?;


            let connect = WebSocket::connect(connect_url).fuse();
            let timeout = executor.timer(CONNECT_TIMEOUT).fuse();
            futures::pin_mut!(connect, timeout);
            let websocket = futures::select_biased! {
                result = connect => result.map_err(|error| anyhow!("failed to connect to Cloud WebSocket: {error}"))?,
                _ = timeout => return Err(anyhow!("timed out connecting to Cloud WebSocket")),
            };

            Ok(Connection::new(websocket))
        }))
    }
}

View on GitHub (pinned to f4178619ac)

Solutions

  1. Check for slow or lossy network conditions between client and the Zed Cloud endpoint
  2. Retry the connection when the network improves
  3. Investigate server-side latency if timeouts persist on a healthy connection
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at crates/cloud_api_client/src/websocket/web.rs:73 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/7c78d0cdcc3b3949. Report an issue: GitHub.