zed-industries/zed · error
invalid URL scheme
Error message
invalid URL scheme: {scheme} What it means
CloudApiClient::connect rewrites the /client/users/connect URL from https/http to wss/ws before opening the websocket; when the base URL carries any other scheme, the match arm rejects it with this error embedding the offending scheme, meaning the configured cloud base URL is not a web URL (misconfigured override or malformed build URL).
Solutions
- Ensure the Zed cloud base URL uses https:// (or http:// for local dev)
- Remove or fix any custom cloud URL override that introduced a non-web scheme
- Validate the scheme at configuration load time and fall back to the default URL
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/cloud_api_client/src/websocket/native.rs:71 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/c3c09448f3d4a1d3.
Report an issue: GitHub.
Appendix: source
Thrown at crates/cloud_api_client/src/websocket/native.rs:71
}
}
}
});
(message_rx.into_stream().boxed(), task)
}
}
impl CloudApiClient {
pub fn connect(self: &std::sync::Arc<Self>, cx: &App) -> Result<Task<Result<Connection>>> {
let mut connect_url = self
.http_client
.build_zed_cloud_url("/client/users/connect")?;
connect_url
.set_scheme(match connect_url.scheme() {
"https" => "wss",
"http" => "ws",
scheme => Err(anyhow!("invalid URL scheme: {scheme}"))?,
})
.map_err(|_| anyhow!("failed to set URL scheme"))?;
let credentials = self.credentials.read();
let credentials = credentials.as_ref().context("no credentials provided")?;
let authorization_header = format!("{} {}", credentials.user_id, credentials.access_token);
Ok(gpui_tokio::Tokio::spawn_result(cx, async move {
let websocket = WebSocket::connect(connect_url)
.with_request(
request::Builder::new()
.header("Authorization", authorization_header)
.header(PROTOCOL_VERSION_HEADER_NAME, PROTOCOL_VERSION.to_string()),
)
.await?;
Ok(Connection::new(websocket))
}))View on GitHub (pinned to f4178619ac)