zed-industries/zed · error

invalid hello message received: {:?}

Error message

invalid hello message received: {:?}

What it means

When establishing an RPC connection, the first message from the server must be a proto::Hello envelope. This error means the first message had a different payload type, so the connection is speaking to something that is not a matching Zed collab server (or an incompatible version).

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 bc538def45)

Solutions

  1. Verify the server URL actually points to a Zed collab RPC endpoint
  2. Upgrade client and server to matching versions (custom deployments must rebuild collab from the same commit)
  3. Disable SSL inspection for the zed.dev/collab host or add proper bypass rules
Defensive patterns

Strategy: validation

Try / catch

let peer_id = peer_id.await.map_err(|err| {
    if err.to_string().starts_with("invalid hello message") {
        // wrong endpoint or version mismatch; do not retry the same URL
        anyhow!("server did not speak the Zed RPC protocol; check server URL and versions")
    } else {
        err
    }
})?;

Prevention

When it happens

Trigger: incoming.next() returns a message whose payload_type_name() is not Hello: pointing the client at the wrong URL (an HTTP server, a different gRPC service), a man-in-the-middle proxy rewriting the stream, or a client/server protocol version mismatch.

Common situations: Custom ZED_SERVER_URL / self-hosted collab deployments with mismatched versions; local development against a stub server; SSL-intercepting proxies corrupting the framing.

Related errors


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