zed-industries/zed · error

invalid rpc url

Error message

invalid rpc url: {}

What it means

The RPC URL string (from ZED_RPC_URL or the built /rpc path) was parsed with Url::parse but its scheme component was not http/https; the invalid scheme value is embedded in the message, meaning the configured endpoint URL is malformed at the scheme level (e.g. missing scheme or a non-web scheme).

Solutions

  1. Fix the ZED_RPC_URL value to start with http:// or https://
  2. Remove the override to use the default /rpc URL
  3. Validate the URL at configuration-load time to surface the problem earlier
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/client/src/client.rs:1354 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/717b9e9632c07d37. Report an issue: GitHub.

Appendix: source

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

        let user_agent = http.user_agent().cloned();
        let credentials = credentials.clone();
        let rpc_url = self.rpc_url(http, release_channel);
        let system_id = self.telemetry.system_id();
        let metrics_id = self.telemetry.metrics_id();
        cx.spawn(async move |cx| {
            use HttpOrHttps::*;

            #[derive(Debug)]
            enum HttpOrHttps {
                Http,
                Https,
            }

            let mut rpc_url = rpc_url.await?;
            let url_scheme = match rpc_url.scheme() {
                "https" => Https,
                "http" => Http,
                _ => Err(anyhow!("invalid rpc url: {}", rpc_url))?,
            };

            let stream = gpui_tokio::Tokio::spawn_result(cx, {
                let rpc_url = rpc_url.clone();
                async move {
                    let rpc_host = rpc_url
                        .host_str()
                        .zip(rpc_url.port_or_known_default())
                        .context("missing host in rpc url")?;
                    Ok(match proxy {
                        Some(proxy) if !excluded_from_proxy(rpc_host.0) => {
                            connect_proxy_stream(&proxy, rpc_host).await?
                        }
                        _ => Box::new(TcpStream::connect(rpc_host).await?),
                    })
                }
            })
            .await?;

View on GitHub (pinned to f4178619ac)