{"record":{"id":"26c78c9520e1dd3a","repo":"cjpais/Handy","slug":"complete-model-file-not-found","errorCode":null,"errorMessage":"Complete model file not found: {}","messagePattern":"Complete model file not found: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/src/managers/model.rs","lineNumber":2627,"sourceCode":"        if model_info.is_directory {\n            if !model_path.exists() || !model_path.is_dir() {\n                self.mark_model_unavailable(model_id);\n                return Err(anyhow::anyhow!(\n                    \"Complete model directory not found: {}\",\n                    model_id\n                ));\n            }\n            if partial_path.exists() {\n                return Err(anyhow::anyhow!(\n                    \"Model directory is incomplete: {}\",\n                    model_id\n                ));\n            }\n            Ok(model_path)\n        } else {\n            if !model_path.exists() {\n                self.mark_model_unavailable(model_id);\n                return Err(anyhow::anyhow!(\n                    \"Complete model file not found: {}\",\n                    model_id\n                ));\n            }\n            if partial_path.exists() {\n                return Err(anyhow::anyhow!(\"Model file is incomplete: {}\", model_id));\n            }\n            Ok(model_path)\n        }\n    }\n\n    pub fn cancel_download(&self, model_id: &str) -> Result<()> {\n        debug!(\"ModelManager: cancel_download called for: {}\", model_id);\n\n        // Trigger the cancellation token to stop the download. The HF path\n        // aborts its in-flight chunk tasks and unwinds promptly; the URL path\n        // observes it on the next chunk of its stream loop.\n        {","sourceCodeStart":2609,"sourceCodeEnd":2645,"githubUrl":"https://github.com/cjpais/Handy/blob/ba10ce1943ef34e93c09494027fc0b9ced2e8a44/src-tauri/src/managers/model.rs#L2609-L2645","documentation":"Returned by ModelManager::get_model_path() for file-based models when neither a complete model file nor a state without a matching .partial download exists — i.e., there is nothing on disk to load for the given model_id. It is the 'the model you asked for is not present locally' error. Directory-based models have a sibling 'Complete model directory not found' variant just above.","triggerScenarios":"Calling get_model_path(model_id) when the model was never downloaded, a previous download left only a .partial file, the models directory was moved/cleaned, or files were deleted externally while the catalog still marks the model as downloaded.","commonSituations":"Asking transcription to load a model right after a fresh install without downloading; users clearing app data / model cache folders; a download interrupted by app exit leaving only partial files; settings pointing at a model removed in a newer catalog.","solutions":["Download the model first via the model manager / model-selector UI before requesting its path.","Check is_downloaded (or list models) to confirm on-disk state instead of assuming the catalog reflects disk.","If a .partial file lingers from an interrupted download, resume or restart the download — do not delete the partial if resume is desired.","Verify the app's model data directory was not moved or cleaned by an external tool (disk cleaners are a common culprit)."],"exampleFix":"// before\nlet path = model_manager.get_model_path(model_id)?;\n\n// after — gate on download state and recover\nif !model_manager.get_model_info(model_id).map(|i| i.is_downloaded).unwrap_or(false) {\n    model_manager.download_model(model_id, None).await?;\n}\nlet path = model_manager.get_model_path(model_id)?;","handlingStrategy":"validation","validationCode":"// Check on-disk state before asking for a path\nlet info = model_manager.get_model_info(model_id)\n    .ok_or_else(|| anyhow::anyhow!(\"unknown model id {model_id}\"))?;\nif !info.is_downloaded {\n    model_manager.download_model(model_id, None).await?;\n}\nlet path = model_manager.get_model_path(model_id)?;","typeGuard":"fn model_is_ready(m: &ModelInfo) -> bool {\n    m.is_downloaded // catalog flag mirrors a verified on-disk file\n}","tryCatchPattern":"match model_manager.get_model_path(model_id) {\n    Ok(p) => p,\n    Err(e) if e.to_string().contains(\"Complete model\") => {\n        // nothing on disk: download then retry\n        model_manager.download_model(model_id, None).await?;\n        model_manager.get_model_path(model_id)?\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Always gate load on is_downloaded, never on catalog presence alone.","Do not delete or move files under the models directory manually; use the app's remove-model flow.","Treat a lingering .partial as 'download in progress or interrupted' — resume it rather than assuming a complete model.","After external disk cleanup, trigger a state refresh before loading."],"tags":["model","model-path","download","filesystem"],"backgroundTag":"model-file-missing","analyzedSha":"ba10ce1943ef34e93c09494027fc0b9ced2e8a44","analyzedAt":"2026-09-17T15:09:05.215Z","contentChangedAt":"2026-09-17T15:09:05.215Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}