{"record":{"id":"4b8e6c3099ece353","repo":"cjpais/Handy","slug":"hugging-face-download-failed-after-attempt-s","errorCode":null,"errorMessage":"Hugging Face download failed after {} attempt(s): {}","messagePattern":"Hugging Face download failed after (.+?) attempt\\(s\\): (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/src/managers/model.rs","lineNumber":2066,"sourceCode":"                        _ = cancel_token.cancelled() => {\n                            info!(\"HF download cancelled for: {}\", model_id);\n                            return Ok(());\n                        }\n                    }\n                    attempt += 1;\n                }\n            }\n        };\n\n        if let Some(hf_error) = hf_error {\n            // `attempt`, not the schedule length: a sequential stall breaks out early.\n            error!(\n                \"HF download failed for {} after {} attempt(s): {:?}\",\n                model_id, attempt, hf_error\n            );\n            let mirrors = crate::catalog::mirror_fallbacks(&model_id);\n            if mirrors.is_empty() {\n                return Err(anyhow::anyhow!(\n                    \"Hugging Face download failed after {} attempt(s): {}\",\n                    attempt,\n                    hf_error\n                ));\n            }\n            let mut completed = false;\n            for mirror in &mirrors {\n                info!(\"Falling back to mirror for {}: {}\", model_id, mirror.url);\n                match self\n                    .download_from_mirror(&model_id, &filename, mirror, cancel_token.clone())\n                    .await\n                {\n                    Ok(true) => {\n                        completed = true;\n                        break;\n                    }\n                    Ok(false) => {\n                        info!(\"Mirror download cancelled for: {}\", model_id);","sourceCodeStart":2048,"sourceCodeEnd":2084,"githubUrl":"https://github.com/cjpais/Handy/blob/98a4d80cce8ad41efec2a419b59d9e81229a35d7/src-tauri/src/managers/model.rs#L2048-L2084","documentation":"Terminal failure of download_hf_model when every attempt in the stream/backoff ladder failed and crate::catalog::mirror_fallbacks(&model_id) returned no mirrors for that model. attempt is the actual attempt counter, not the schedule length, because a sequential stall breaks out early.","triggerScenarios":"Persistent network failure (offline, DNS down, firewall blocking huggingface.co) across all 4→1→1→1 stream attempts with exponential backoff, for a model that has no mirror entry in the catalog.","commonSituations":"Fully offline machines; firewalls that whitelist only blob.handy.computer and block huggingface.co; hub outages for repos without mirrors; long-running downloads on unstable links that stall past every retry.","solutions":["Restore connectivity to huggingface.co (DNS, proxy, firewall) and retry the download","Check whether the model has a mirror in catalog::mirror_fallbacks — if yes this error is unexpected and the mirror logs hold the real cause","As a workaround, download the model file manually into the models directory and rescan"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match manager.download_model(id).await {\n    Ok(()) => (),\n    Err(e) if e.to_string().starts_with(\"Hugging Face download failed\") => {\n        // transient network exhaustion — inform and let the user retry later\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Check connectivity to huggingface.co before kicking off large downloads","Surfacing this error means no mirrors exist for the model — a network fix is the only automated path","Manual download into the models dir is the supported offline workaround"],"tags":["rust","hf-hub","download","network","exhausted-retries"],"backgroundTag":"model-download-failed","analyzedSha":"98a4d80cce8ad41efec2a419b59d9e81229a35d7","analyzedAt":"2026-08-16T20:58:09.966Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}