{"record":{"id":"717b9e9632c07d37","repo":"zed-industries/zed","slug":"invalid-rpc-url","errorCode":null,"errorMessage":"invalid rpc url: {}","messagePattern":"invalid rpc url: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/client/src/client.rs","lineNumber":1354,"sourceCode":"        let user_agent = http.user_agent().cloned();\n        let credentials = credentials.clone();\n        let rpc_url = self.rpc_url(http, release_channel);\n        let system_id = self.telemetry.system_id();\n        let metrics_id = self.telemetry.metrics_id();\n        cx.spawn(async move |cx| {\n            use HttpOrHttps::*;\n\n            #[derive(Debug)]\n            enum HttpOrHttps {\n                Http,\n                Https,\n            }\n\n            let mut rpc_url = rpc_url.await?;\n            let url_scheme = match rpc_url.scheme() {\n                \"https\" => Https,\n                \"http\" => Http,\n                _ => Err(anyhow!(\"invalid rpc url: {}\", rpc_url))?,\n            };\n\n            let stream = gpui_tokio::Tokio::spawn_result(cx, {\n                let rpc_url = rpc_url.clone();\n                async move {\n                    let rpc_host = rpc_url\n                        .host_str()\n                        .zip(rpc_url.port_or_known_default())\n                        .context(\"missing host in rpc url\")?;\n                    Ok(match proxy {\n                        Some(proxy) if !excluded_from_proxy(rpc_host.0) => {\n                            connect_proxy_stream(&proxy, rpc_host).await?\n                        }\n                        _ => Box::new(TcpStream::connect(rpc_host).await?),\n                    })\n                }\n            })\n            .await?;","sourceCodeStart":1336,"sourceCodeEnd":1372,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/client/src/client.rs#L1336-L1372","documentation":"Before connecting, the client validates that the resolved RPC URL scheme is exactly http or https. Any other scheme (file, wss, ssh, missing scheme from a malformed string) is rejected immediately with the full URL printed.","triggerScenarios":"The final rpc_url (from /rpc discovery or direct configuration) has a scheme other than http/https: typos like `htp://`, base URLs entered as `wss://host`, or a URL missing the `//` separator.","commonSituations":"Users pasting a websocket URL where an https URL belongs; environment variables (ZED_SERVER_URL) with stray characters; config files edited by hand.","solutions":["Set the URL with a proper scheme: `https://your-server.example.com` (or `http://` for local dev)","Re-check the full URL string for typos; the error message prints exactly what was parsed","If the bad URL came from the /rpc Location header, fix the server's redirect target"],"exampleFix":"# before\nexport ZED_SERVER_URL=wss://zed.example.com\n\n# after\nexport ZED_SERVER_URL=https://zed.example.com","handlingStrategy":"validation","validationCode":"fn valid_rpc_url(url: &str) -> bool {\n    matches!(url::Url::parse(url), Ok(parsed) if matches!(parsed.scheme(), \"http\" | \"https\"))\n}\n\nassert!(valid_rpc_url(&server_url), \"server URL must be http(s): {server_url}\");","typeGuard":"fn as_http_url(s: &str) -> Option<url::Url> {\n    url::Url::parse(s).ok().filter(|u| matches!(u.scheme(), \"http\" | \"https\"))\n}","tryCatchPattern":null,"preventionTips":["Validate URL scheme at config-load time, not at connect time","Keep server URLs in one config source to avoid divergent copies","Reject wss:// in user input for the RPC URL field"],"tags":["configuration","url","client"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}