Zackriya-Solutions/meetily · error

Failed to create HTTP client: {}

Error message

Failed to create HTTP client: {}

What it means

reqwest's Client::builder() (tcp_nodelay, 1-hour total timeout, 30 s connect timeout) failed to build. Builder failures are configuration-level — most commonly TLS backend initialization (missing CA store) — and no request is ever attempted.

Source

Thrown at frontend/src-tauri/src/summary/summary_engine/model_manager.rs:479

        // Check for existing partial download to resume
        let existing_size: u64 = if file_path.exists() {
            fs::metadata(&file_path)
                .await
                .map(|m| m.len())
                .unwrap_or(0)
        } else {
            0
        };

        // Download the file with optimized client settings
        let client = Client::builder()
            .tcp_nodelay(true) // Disable Nagle's algorithm for faster 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))?;

        // Build request with Range header if resuming
        let mut request = client.get(&model_def.download_url);
        if existing_size > 0 {
            log::info!(
                "Resuming download from byte {} ({:.1} MB)",
                existing_size,
                existing_size as f64 / (1024.0 * 1024.0)
            );
            request = request.header("Range", format!("bytes={}-", existing_size));
        }

        let response = request
            .send()
            .await
            .map_err(|e| anyhow!("Failed to start download: {}", e))?;

        // Check response status - 200 OK (full download) or 206 Partial Content (resume)

View on GitHub (pinned to 0281737d87)

Solutions

  1. Log the builder error — it names the TLS/config cause
  2. Install CA certificates (ca-certificates package) in containers, or pin one TLS backend via reqwest features (e.g. rustls-tls)
  3. Run cargo tree -i reqwest to detect duplicate TLS backends after dependency changes
  4. A single retry at startup can mask transient init failure, but repeated failures indicate a build/env defect
Defensive patterns

Strategy: fallback

Try / catch

match download_result {
    Err(e) if e.to_string().starts_with("Failed to create HTTP client") => {
        // TLS/config-level: report env problem (CA store, TLS backend) — do not loop-retry
        report_environment_issue(&e);
    }
    other => other,
}

Prevention

When it happens

Trigger: TLS roots cannot be initialized in a minimal/stripped container; conflicting TLS feature flags producing two reqwest backends; resource exhaustion preventing allocator or runtime setup.

Common situations: Running the binary in a scratch Docker image without CA certificates; cargo feature changes to reqwest's TLS backends between builds; heavily memory-constrained machines where TLS init fails.

Related errors


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