{"record":{"id":"43f7c6a707f60405","repo":"Zackriya-Solutions/meetily","slug":"failed-to-create-http-client","errorCode":null,"errorMessage":"Failed to create HTTP client: {}","messagePattern":"Failed to create HTTP client: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs","lineNumber":642,"sourceCode":"                return Err(anyhow!(\"Failed to create model directory: {}\", e));\n            }\n        }\n\n        // Clean up incomplete downloads before starting\n        log::info!(\"Checking for incomplete model files to clean up...\");\n        if let Err(e) = self.clean_incomplete_model_directory(model_dir).await {\n            log::warn!(\"Failed to clean incomplete model directory: {}\", e);\n            // Continue anyway - we'll handle errors during download\n        }\n\n        // Optimized HTTP client for large file downloads\n        let client = reqwest::Client::builder()\n            .tcp_nodelay(true)              // Disable Nagle's algorithm for better streaming\n            .pool_max_idle_per_host(1)      // Keep connection alive\n            .timeout(Duration::from_secs(3600))  // 1 hour timeout for large files\n            .connect_timeout(Duration::from_secs(30))\n            .build()\n            .map_err(|e| anyhow!(\"Failed to create HTTP client: {}\", e))?;\n\n        let total_files = files_to_download.len();\n\n        // Calculate total download size for weighted progress\n        // Note: These are approximate sizes based on HuggingFace repo inspection\n        let file_sizes: std::collections::HashMap<&str, u64> = match model_info.quantization {\n            QuantizationType::Int8 => {\n                if model_name.contains(\"-v2-\") {\n                    // V2 model sizes\n                    [\n                        (\"encoder-model.int8.onnx\", 652_000_000u64),       // 652 MB\n                        (\"decoder_joint-model.int8.onnx\", 9_000_000u64),   // 9 MB\n                        (\"nemo128.onnx\", 140_000u64),                      // 140 KB\n                        (\"vocab.txt\", 9_380u64),                           // 9.38 KB\n                    ].iter().cloned().collect()\n                } else {\n                    // V3 model sizes (default)\n                    [","sourceCodeStart":624,"sourceCodeEnd":660,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs#L624-L660","documentation":"Returned by download_model_detailed when reqwest::Client::builder()...build() fails. The builder here sets tcp_nodelay, a 1-hour total timeout, a 30-second connect timeout, and a connection pool; build() practically only fails when the TLS backend cannot initialize (certificate store/proxy configuration problems) or the builder options are invalid for the environment.","triggerScenarios":"Building the client on a machine where the TLS backend fails to initialize (broken system trust store, missing root certificates in a minimal container); environment proxy variables (HTTP_PROXY/HTTPS_PROXY/ALL_PROXY) pointing at an invalid URI in setups where reqwest picks them up; extremely constrained environments where allocating the pool or timers fails.","commonSituations":"Corporate MITM proxy with custom env configuration; running the desktop app in a hardened/minimal OS or container without ca-certificates; leftover proxy env vars from a VPN client.","solutions":["Restart the app once - transient TLS init failures sometimes clear on a fresh process","Unset or fix HTTP_PROXY/HTTPS_PROXY/ALL_PROXY environment variables if they reference dead or malformed proxy URLs","On Linux, ensure the system CA certificate store is installed and healthy (update-ca-certificates / ca-certificates package)","Report the inner error text with the issue - the '{}' carries reqwest's reason and pinpoints the subsystem"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match engine.download_model(name, None).await {\n    Err(e) if e.to_string().contains(\"Failed to create HTTP client\") => {\n        // environment problem (TLS/proxy): prompt restart, ask user to check proxy env vars,\n        // and report the inner reqwest error - retrying unchanged will not help\n        return Err(anyhow!(\"network stack unavailable: {e}\"));\n    }\n    other => other?,\n}","preventionTips":["Keep the OS CA certificate store healthy (update-ca-certificates / OS updates)","Avoid malformed HTTP_PROXY/HTTPS_PROXY env vars on machines running the app","Capture the inner error string in bug reports - it identifies TLS vs configuration failures"],"tags":["parakeet","reqwest","http-client","tls","proxy"],"backgroundTag":"http-client-init-failed","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}