{"record":{"id":"272a6dad5c290cd1","repo":"zed-industries/zed","slug":"failed-to-initialize-http-client","errorCode":null,"errorMessage":"Failed to initialize HTTP client","messagePattern":"Failed to initialize HTTP client","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/reqwest_client/src/reqwest_client.rs","lineNumber":55,"sourceCode":"            // Detect and drop connections that have silently gone bad on a\n            // flaky path (NAT timeouts, resets) instead of reusing them. A\n            // stale reused HTTP/2 connection is a common source of\n            // `BadRecordMac` TLS errors against long-lived endpoints.\n            .tcp_keepalive(Duration::from_secs(30))\n            .pool_idle_timeout(Duration::from_secs(30))\n            .http2_keep_alive_interval(Duration::from_secs(15))\n            .http2_keep_alive_timeout(Duration::from_secs(10))\n            .http2_keep_alive_while_idle(true);\n        match read_timeout {\n            Some(read_timeout) => builder.read_timeout(read_timeout),\n            None => builder,\n        }\n    }\n\n    pub fn new() -> Self {\n        Self::builder(None)\n            .build()\n            .expect(\"Failed to initialize HTTP client\")\n            .into()\n    }\n\n    pub fn user_agent(agent: &str) -> anyhow::Result<Self> {\n        let mut map = HeaderMap::new();\n        map.insert(http::header::USER_AGENT, HeaderValue::from_str(agent)?);\n        let client = Self::builder(None).default_headers(map).build()?;\n        Ok(client.into())\n    }\n\n    pub fn proxy_and_user_agent(proxy: Option<Url>, user_agent: &str) -> anyhow::Result<Self> {\n        Self::proxy_user_agent_and_read_timeout(proxy, user_agent, None)\n    }\n\n    /// Like [`ReqwestClient::proxy_and_user_agent`], but also applies a\n    /// per-read idle timeout. `read_timeout` fires only after that long with no\n    /// bytes received on a response body and resets on every chunk, so it\n    /// aborts a silently stalled stream without disturbing a healthy one that","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/reqwest_client/src/reqwest_client.rs#L37-L73","documentation":"ReqwestClient::new failed to build the underlying reqwest client after applying keep-alive/timeout configuration — typically an invalid read_timeout value or reqwest builder error, meaning no HTTP client can be created in this process.","triggerScenarios":"Thrown at crates/reqwest_client/src/reqwest_client.rs:55 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check read_timeout is a sane non-zero duration","Log the underlying reqwest builder error","Retry with default configuration if custom options fail"],"exampleFix":null,"handlingStrategy":"retry","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-14T05:17:10.506Z"}