zed-industries/zed · error

unexpected /rpc response status

Error message

unexpected /rpc response status {}

What it means

When discovering the RPC endpoint, the client GETs the /rpc URL (with any release-channel query param) and received a non-success HTTP status; the status code is embedded, meaning the /rpc probe was rejected by the server (misconfigured gateway, outage, or redirect) before an RPC connection was attempted.

Solutions

  1. Retry the RPC discovery after checking network connectivity
  2. Verify any custom ZED_RPC_URL override points at a valid /rpc endpoint
  3. Check proxy/SSL interception that may return error statuses for the probe request
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at crates/client/src/client.rs:1310 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/62745a4943741f4a. Report an issue: GitHub.

Appendix: source

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

            #[cfg(any(test, feature = "test-support"))]
            if let Some(url) = url_override {
                return Ok(url);
            }

            if let Some(url) = &*ZED_RPC_URL {
                return Url::parse(url).context("invalid rpc url");
            }

            let mut url = http.build_url("/rpc");
            if let Some(preview_param) =
                release_channel.and_then(|channel| channel.release_query_param())
            {
                url += "?";
                url += preview_param;
            }

            let response = http.get(&url, Default::default(), false).await?;
            anyhow::ensure!(
                response.status().is_redirection(),
                "unexpected /rpc response status {}",
                response.status()
            );
            let collab_url = response
                .headers()
                .get("Location")
                .context("missing location header in /rpc response")?
                .to_str()
                .map_err(EstablishConnectionError::other)?
                .to_string();
            Url::parse(&collab_url).with_context(|| format!("parsing collab rpc url {collab_url}"))
        }
    }

    fn establish_websocket_connection(
        self: &Arc<Self>,
        credentials: &Credentials,

View on GitHub (pinned to f4178619ac)