Zackriya-Solutions/meetily · error

Failed to create HTTP client: {}

Error message

Failed to create HTTP client: {}

What it means

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.

Source

Thrown at frontend/src-tauri/src/parakeet_engine/parakeet_engine.rs:642

                return Err(anyhow!("Failed to create model directory: {}", e));
            }
        }

        // Clean up incomplete downloads before starting
        log::info!("Checking for incomplete model files to clean up...");
        if let Err(e) = self.clean_incomplete_model_directory(model_dir).await {
            log::warn!("Failed to clean incomplete model directory: {}", e);
            // Continue anyway - we'll handle errors during download
        }

        // Optimized HTTP client for large file downloads
        let client = reqwest::Client::builder()
            .tcp_nodelay(true)              // Disable Nagle's algorithm for better streaming
            .pool_max_idle_per_host(1)      // Keep connection alive
            .timeout(Duration::from_secs(3600))  // 1 hour timeout for large files
            .connect_timeout(Duration::from_secs(30))
            .build()
            .map_err(|e| anyhow!("Failed to create HTTP client: {}", e))?;

        let total_files = files_to_download.len();

        // Calculate total download size for weighted progress
        // Note: These are approximate sizes based on HuggingFace repo inspection
        let file_sizes: std::collections::HashMap<&str, u64> = match model_info.quantization {
            QuantizationType::Int8 => {
                if model_name.contains("-v2-") {
                    // V2 model sizes
                    [
                        ("encoder-model.int8.onnx", 652_000_000u64),       // 652 MB
                        ("decoder_joint-model.int8.onnx", 9_000_000u64),   // 9 MB
                        ("nemo128.onnx", 140_000u64),                      // 140 KB
                        ("vocab.txt", 9_380u64),                           // 9.38 KB
                    ].iter().cloned().collect()
                } else {
                    // V3 model sizes (default)
                    [

View on GitHub (pinned to 0281737d87)

Solutions

  1. Restart the app once - transient TLS init failures sometimes clear on a fresh process
  2. Unset or fix HTTP_PROXY/HTTPS_PROXY/ALL_PROXY environment variables if they reference dead or malformed proxy URLs
  3. On Linux, ensure the system CA certificate store is installed and healthy (update-ca-certificates / ca-certificates package)
  4. Report the inner error text with the issue - the '{}' carries reqwest's reason and pinpoints the subsystem
Defensive patterns

Strategy: try-catch

Try / catch

match engine.download_model(name, None).await {
    Err(e) if e.to_string().contains("Failed to create HTTP client") => {
        // environment problem (TLS/proxy): prompt restart, ask user to check proxy env vars,
        // and report the inner reqwest error - retrying unchanged will not help
        return Err(anyhow!("network stack unavailable: {e}"));
    }
    other => other?,
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of Zackriya-Solutions/meetily@0281737d87 (2026-08-16). Data as JSON: /api/errors/43f7c6a707f60405. Report an issue: GitHub.