Zackriya-Solutions/meetily · error · anyhow::Error

Failed to start download: {}

Error message

Failed to start download: {}

What it means

reqwest's client.get(model_url).send() failed at the transport layer: DNS resolution failure, TCP connect refused, TLS handshake error, or no route to host. This is distinct from a non-2xx response (that is error 193) — here no HTTP response was received at all. The request targets huggingface.co, so any blocker on that host triggers it.

Source

Thrown at frontend/src-tauri/src/whisper_engine/whisper_engine.rs:971

        if !self.models_dir.exists() {
            fs::create_dir_all(&self.models_dir).await
                .map_err(|e| anyhow!("Failed to create models directory: {}", e))?;
        }
        
        // Update model status to downloading
        {
            let mut models = self.available_models.write().await;
            if let Some(model_info) = models.get_mut(model_name) {
                model_info.status = ModelStatus::Downloading { progress: 0 };
            }
        }
        
        log::info!("Creating HTTP client and starting request...");
        let client = Client::new();
        
        log::info!("Sending GET request to: {}", model_url);
        let response = client.get(model_url).send().await
            .map_err(|e| anyhow!("Failed to start download: {}", e))?;
        
        log::info!("Received response with status: {}", response.status());
        if !response.status().is_success() {
            // Remove from active downloads on error
            let mut active = self.active_downloads.write().await;
            active.remove(model_name);
            return Err(anyhow!("Download failed with status: {}", response.status()));
        }
        
        let total_size = response.content_length().unwrap_or(0);
        log::info!("Response successful, content length: {} bytes ({:.1} MB)", total_size, total_size as f64 / (1024.0 * 1024.0));
        
        if total_size == 0 {
            log::warn!("Content length is 0 or unknown - download may not show accurate progress");
        }
        
        let mut file = fs::File::create(&file_path).await
            .map_err(|e| anyhow!("Failed to create file: {}", e))?;

View on GitHub (pinned to 0281737d87)

Solutions

  1. Verify basic connectivity: curl -I https://huggingface.co from the same machine and user
  2. If behind a proxy, set HTTP_PROXY/HTTPS_PROXY correctly (reqwest honors them) or fix the broken proxy env var
  3. For TLS-intercepting proxies, add the proxy CA to the system trust store
  4. Retry after transient DNS/connection drops — the call is idempotent from byte 0
Defensive patterns

Strategy: retry

Validate before calling

// Rust: fail fast with a clear signal instead of a raw send() error
if reqwest::get("https://huggingface.co").await.is_err() {
    return Err(anyhow!("No network route to huggingface.co — check connectivity/proxy"));
}

Try / catch

let mut backoff = 1;
loop {
  match engine.download_model(name, cb.clone()).await {
    Ok(_) => break,
    Err(e) if String::from(&e).contains("Failed to start download") && backoff <= 4 => {
      tokio::time::sleep(Duration::from_secs(backoff)).await;
      backoff *= 2;
    }
    Err(e) => return Err(e),
  }
}

Prevention

When it happens

Trigger: Machine offline; DNS cannot resolve huggingface.co; corporate firewall or proxy blocking the CONNECT; TLS-intercepting proxy with an untrusted CA; IPv6-only misconfiguration.

Common situations: Firewalled enterprise networks; reqwest picking up a broken HTTP(S)_PROXY environment variable; captive portals; VPN split-tunnel rules excluding huggingface.co.

Related errors


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