{"record":{"id":"57fc648f69073455","repo":"BloopAI/vibe-kanban","slug":"failed-to-build-reqwest-client","errorCode":null,"errorMessage":"failed to build reqwest client","messagePattern":"failed to build reqwest client","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/remote/src/mail.rs","lineNumber":127,"sourceCode":"\n        Ok(())\n    }\n}\n\npub struct LoopsMailer {\n    client: reqwest::Client,\n    api_key: String,\n    invite_template_id: String,\n    review_ready_template_id: String,\n    review_failed_template_id: String,\n}\n\nimpl LoopsMailer {\n    pub fn new(api_key: String) -> Self {\n        let client = reqwest::Client::builder()\n            .timeout(Duration::from_secs(5))\n            .build()\n            .expect(\"failed to build reqwest client\");\n\n        let invite_template_id = env_or(\"LOOPS_INVITE_TEMPLATE_ID\", DEFAULT_INVITE_TEMPLATE_ID);\n        let review_ready_template_id = env_or(\n            \"LOOPS_REVIEW_READY_TEMPLATE_ID\",\n            DEFAULT_REVIEW_READY_TEMPLATE_ID,\n        );\n        let review_failed_template_id = env_or(\n            \"LOOPS_REVIEW_FAILED_TEMPLATE_ID\",\n            DEFAULT_REVIEW_FAILED_TEMPLATE_ID,\n        );\n\n        Self {\n            client,\n            api_key,\n            invite_template_id,\n            review_ready_template_id,\n            review_failed_template_id,\n        }","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/BloopAI/vibe-kanban/blob/4deb7eca8f381f7cbc1f9d15515a9ab8f8009053/crates/remote/src/mail.rs#L109-L145","documentation":"reqwest::Client::builder().build() returns a Result; it fails if TLS backend initialization, system proxy resolution, or other client setup fails. The code unwraps it with expect(\"failed to build reqwest client\"), so a builder failure aborts the process with this panic message while constructing the LoopsMailer.","triggerScenarios":"`LoopsMailer::new(api_key)` is called when reqwest cannot initialize the TLS backend (e.g. rustls crypto provider not installed or native-tls issues) or system proxy configuration is malformed.","commonSituations":"rustls crypto provider not installed before client construction (see install_default panics elsewhere in this codebase); conflicting reqwest/tls feature flags; invalid http_proxy/https_proxy env vars; loaded CA certificate files missing or unreadable.","solutions":["Ensure rustls crypto provider is installed (rustls::crypto::aws_lc_rs::default_provider().install_default()) before building any reqwest client","Replace expect with proper error handling: return Result<Self> from LoopsMailer::new and log/propagate the reqwest::Error","Check proxy-related env vars (http_proxy/https_proxy/no_proxy) for malformed URLs","Verify TLS features in Cargo.toml are consistent (reqwest with rustls-tls, single crypto provider)"],"exampleFix":"// before\nlet client = reqwest::Client::builder().timeout(Duration::from_secs(5)).build().expect(\"failed to build reqwest client\");\n// after\nlet client = reqwest::Client::builder().timeout(Duration::from_secs(5)).build()\n    .map_err(|e| anyhow::anyhow!(\"failed to build reqwest client: {e}\"))?;","handlingStrategy":"try-catch","validationCode":"fn reqwest_buildable() -> bool {\n    reqwest::Client::builder().timeout(Duration::from_secs(5)).build().is_ok()\n}","typeGuard":null,"tryCatchPattern":"match reqwest::Client::builder().timeout(Duration::from_secs(5)).build() {\n    Ok(c) => c,\n    Err(e) => { eprintln!(\"reqwest client build failed: {e}\"); std::process::exit(1); }\n}","preventionTips":["Install the rustls crypto provider before building clients","Keep reqwest/TLS feature flags consistent across the workspace","Check proxy env vars when builds fail in restricted environments","Return Result from constructors instead of expect"],"tags":["rust","panic","reqwest","http","tls"],"backgroundTag":"http-client-init-failed","analyzedSha":"4deb7eca8f381f7cbc1f9d15515a9ab8f8009053","analyzedAt":"2026-08-29T09:24:13.446Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}