{"record":{"id":"f86bbcf817430a5e","repo":"zed-industries/zed","slug":"upstream-proxy-url-url-has-no-host","errorCode":null,"errorMessage":"upstream proxy url '{url}' has no host","messagePattern":"upstream proxy url '(.+?)' has no host","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/http_proxy/src/proxy/upstream.rs","lineNumber":136,"sourceCode":"        let normalized = if url.contains(\"://\") {\n            url.to_string()\n        } else {\n            format!(\"http://{url}\")\n        };\n\n        let parsed = Url::parse(&normalized)\n            .with_context(|| format!(\"parsing upstream proxy url '{url}'\"))?;\n\n        if parsed.scheme() != \"http\" {\n            bail!(\n                \"unsupported upstream proxy scheme '{}://' in '{url}': only http:// is supported\",\n                parsed.scheme()\n            );\n        }\n\n        let host = parsed\n            .host_str()\n            .ok_or_else(|| anyhow!(\"upstream proxy url '{url}' has no host\"))?;\n        // Brackets around IPv6 literals are URL syntax, not part of the\n        // address; strip them so the host can be handed to\n        // `ToSocketAddrs` (which rejects bracketed forms).\n        let host = host\n            .strip_prefix('[')\n            .and_then(|stripped| stripped.strip_suffix(']'))\n            .unwrap_or(host)\n            .to_string();\n        // `Url::port` elides scheme-default ports, so a plain `.port()`\n        // can't distinguish `http://proxy:80` from `http://proxy`; treat\n        // both as port 80.\n        let port = parsed\n            .port_or_known_default()\n            .ok_or_else(|| anyhow!(\"upstream proxy url '{url}' must include a port\"))?;\n\n        let auth = if parsed.username().is_empty() {\n            None\n        } else {","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/http_proxy/src/proxy/upstream.rs#L118-L154","documentation":"Validation guard in parse_url of the upstream proxy configuration: after parsing the (scheme-normalized) proxy URL, `Url::host_str()` returned None, meaning the configured proxy string had no host component. A proxy URL like \"http:///path\" or an otherwise malformed value cannot be used to open a connection, so parsing fails.","triggerScenarios":"Thrown at crates/http_proxy/src/proxy/upstream.rs:136 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the proxy environment variable (HTTP_PROXY/HTTPS_PROXY/ALL_PROXY) or setting so it includes a host, e.g. http://proxy.example.com:8080","Ensure the value isn't just a scheme or path with the host missing","Check for stray characters or truncation when the variable was exported"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}