{"record":{"id":"c721f304a49eb1ac","repo":"Zackriya-Solutions/meetily","slug":"failed-to-start-download","errorCode":null,"errorMessage":"Failed to start download: {}","messagePattern":"Failed to start download: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/summary/summary_engine/model_manager.rs","lineNumber":495,"sourceCode":"            .connect_timeout(Duration::from_secs(30))\n            .build()\n            .map_err(|e| anyhow!(\"Failed to create HTTP client: {}\", e))?;\n\n        // Build request with Range header if resuming\n        let mut request = client.get(&model_def.download_url);\n        if existing_size > 0 {\n            log::info!(\n                \"Resuming download from byte {} ({:.1} MB)\",\n                existing_size,\n                existing_size as f64 / (1024.0 * 1024.0)\n            );\n            request = request.header(\"Range\", format!(\"bytes={}-\", existing_size));\n        }\n\n        let response = request\n            .send()\n            .await\n            .map_err(|e| anyhow!(\"Failed to start download: {}\", e))?;\n\n        // Check response status - 200 OK (full download) or 206 Partial Content (resume)\n        let (total_size, resuming) = if response.status() == reqwest::StatusCode::PARTIAL_CONTENT {\n            // Server supports resume - total size = existing + remaining\n            let remaining = response.content_length().unwrap_or(0);\n            log::info!(\"Server supports resume, {} MB remaining\", remaining / (1024 * 1024));\n            (existing_size + remaining, true)\n        } else if response.status().is_success() {\n            // Server doesn't support resume or fresh download\n            if existing_size > 0 {\n                log::warn!(\"Server doesn't support resume, starting fresh download\");\n            }\n            (response.content_length().unwrap_or(0), false)\n        } else {\n            let mut active = self.active_downloads.write().await;\n            active.remove(model_name);\n            return Err(anyhow!(\"Download failed with status: {}\", response.status()));\n        };","sourceCodeStart":477,"sourceCodeEnd":513,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/summary/summary_engine/model_manager.rs#L477-L513","documentation":"client.get(download_url).send() failed before any response arrived: DNS resolution failure, connection refused/timeout, or TLS handshake error while contacting the model host (typically HuggingFace). The URL comes from the model definition, so an unreachable URL also lands here.","triggerScenarios":"Machine offline; DNS cannot resolve huggingface.co; firewall blocking outbound HTTPS; the model's download_url changed or the host is down; proxy rejecting the CONNECT.","commonSituations":"App started in airplane mode; restrictive corporate network; HuggingFace outage; authenticated proxies in enterprise environments.","solutions":["Verify connectivity to the exact download_url from the same machine (curl -I)","Fix DNS/proxy configuration or system CA store, then retry","Retry once the network is restored — partial files resume automatically","Distinguish from HTTP-status errors: if the host answers with 404/403 that is a different failure (download_url is stale)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Cheap reachability probe before the long download\nlet probe = reqwest::Client::new().head(&model_def.download_url).send().await;\nmatch probe {\n    Ok(r) if r.status().is_success() || r.status().as_u16() == 206 => { /* proceed */ }\n    Ok(r) => return Err(anyhow!(\"host answered {} — URL may be stale\", r.status())),\n    Err(e) => return Err(anyhow!(\"host unreachable: {}\", e)),\n}","typeGuard":null,"tryCatchPattern":"let mut attempt = 0;\nloop {\n    match manager.download_model_detailed(name, cb).await {\n        Err(e) if e.to_string().starts_with(\"Failed to start download\") && attempt < 3 => {\n            attempt += 1;\n            tokio::time::sleep(Duration::from_secs(2u64.pow(attempt))).await;\n        }\n        other => break other,\n    }\n}","preventionTips":["Check connectivity before invoking large downloads; surface offline state in the UI","Configure system proxy/CA correctly in enterprise environments","Retry with backoff — partial files resume automatically"],"tags":["network","http","dns","rust"],"backgroundTag":"http-request-failed","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}