zed-industries/zed · error

invalid hello message received

Error message

invalid hello message received: {:?}

What it means

In set_connection, after adding the websocket the client awaits the server's hello handshake message; when a hello arrives but does not deserialize/validate into the expected handshake shape, its debug form is embedded in this error, meaning the remote spoke the protocol incorrectly (version mismatch or a non-Zed endpoint answered).

Solutions

  1. Verify the server URL points at a genuine Zed collaboration endpoint
  2. Update client and server to matching protocol versions
  3. Retry after confirming no HTTP proxy intercepted and rewrote the websocket handshake
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/client/src/client.rs:1195 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at crates/client/src/client.rs:1195

    async fn set_connection(self: &Arc<Self>, conn: Connection, cx: &AsyncApp) -> Result<()> {
        let executor = cx.background_executor();
        log::debug!("add connection to peer");
        let (connection_id, handle_io, mut incoming) = self.peer.add_connection(conn, {
            let executor = executor.clone();
            move |duration| executor.timer(duration)
        });
        let handle_io = executor.spawn(handle_io);

        let peer_id = async {
            log::debug!("waiting for server hello");
            let message = incoming.next().await.context("no hello message received")?;
            log::debug!("got server hello");
            let hello_message_type_name = message.payload_type_name().to_string();
            let hello = message
                .into_any()
                .downcast::<TypedEnvelope<proto::Hello>>()
                .map_err(|_| {
                    anyhow!(
                        "invalid hello message received: {:?}",
                        hello_message_type_name
                    )
                })?;
            let peer_id = hello.payload.peer_id.context("invalid peer id")?;
            Ok(peer_id)
        };

        let peer_id = match peer_id.await {
            Ok(peer_id) => peer_id,
            Err(error) => {
                self.peer.disconnect(connection_id);
                return Err(error);
            }
        };

        log::debug!(
            "set status to connected (connection id: {:?}, peer id: {:?})",

View on GitHub (pinned to f4178619ac)