{"record":{"id":"878debd69bd506a7","repo":"Zackriya-Solutions/meetily","slug":"model-is-corrupted-and-cannot-be-loaded","errorCode":null,"errorMessage":"Model {} is corrupted and cannot be loaded","messagePattern":"Model (.+?) is corrupted and cannot be loaded","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/whisper_engine/whisper_engine.rs","lineNumber":340,"sourceCode":"                // Enhanced acceleration status reporting\n                let acceleration_status = acceleration.status_label();\n\n                log::info!(\"Successfully loaded model: {} with {} (Performance Tier: {:?}, Beam Size: {}, Threads: {:?})\",\n                          model_name, acceleration_status, hardware_profile.performance_tier,\n                          adaptive_config.beam_size, adaptive_config.max_threads);\n                Ok(())\n            },\n            ModelStatus::Missing => {\n                Err(anyhow!(\"Model {} is not downloaded\", model_name))\n            },\n            ModelStatus::Downloading { .. } => {\n                Err(anyhow!(\"Model {} is currently downloading\", model_name))\n            },\n            ModelStatus::Error(ref err) => {\n                Err(anyhow!(\"Model {} has error: {}\", model_name, err))\n            },\n            ModelStatus::Corrupted { .. } => {\n                Err(anyhow!(\"Model {} is corrupted and cannot be loaded\", model_name))\n            }\n        }\n    }\n\n    pub async fn unload_model(&self) -> bool  {\n        let mut ctx_guard = self.current_context.write().await;\n        let unloaded = ctx_guard.take().is_some();\n        if unloaded {\n            log::info!(\"📉Whisper model unloaded\");\n        }\n\n        let mut model_name_guard = self.current_model.write().await;\n        model_name_guard.take();\n\n        unloaded\n    }\n\n    pub async fn get_current_model(&self) -> Option<String> {","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/whisper_engine/whisper_engine.rs#L322-L358","documentation":"load_model matched ModelStatus::Corrupted { file_size, expected_min_size }: the ggml file exists but its size is below the known minimum for that model, detected by the model scanner. Loading would make whisper.cpp fail or emit garbage, so it is refused. The status fields tell you how short the file is.","triggerScenarios":"Download was interrupted so only part of the ggml file was written; disk filled mid-write and truncated the file; calling load_model on such a truncated artifact.","commonSituations":"App killed during download; power loss; copying models with a tool that silently truncates large files; disk quota enforcement on network home directories.","solutions":["Call delete_model(model_name) — it has a dedicated branch for Corrupted that removes the file and resets status to Missing — then download_model again","Verify free disk space is at least the expected model size plus margin before re-downloading","As a fallback, remove ggml-<name>.bin from the models directory manually and rescan"],"exampleFix":"// before\nawait invoke('load_whisper_model', { modelName }); // 'corrupted and cannot be loaded'\n\n// after\nawait invoke('delete_model', { modelName });      // clears the corrupted file\nawait invoke('download_model', { modelName });     // fresh copy\nawait invoke('load_whisper_model', { modelName });","handlingStrategy":"fallback","validationCode":"const models = await invoke<ModelInfo[]>('get_whisper_models');\nconst m = models.find(x => x.name === modelName);\nif (m?.status === 'Corrupted') {\n  await invoke('delete_model', { modelName });     // removes the short file, sets Missing\n  await invoke('download_model', { modelName });   // fetch a clean copy\n}\nawait invoke('load_whisper_model', { modelName });","typeGuard":"const isCorrupted = (m: ModelInfo | undefined): boolean => m?.status === 'Corrupted';","tryCatchPattern":"try {\n  await invoke('load_whisper_model', { modelName });\n} catch (e) {\n  if (String(e).includes('corrupted')) {\n    await invoke('delete_model', { modelName });\n    await invoke('download_model', { modelName });\n    await invoke('load_whisper_model', { modelName });\n  } else { throw e; }\n}","preventionTips":["Check free disk space against the model's expected size before downloading","Treat any interrupted download as suspect: rescan models before allowing a load","Compare file size to the published HF size when copying models between machines"],"tags":["whisper","model-management","corruption","filesystem","rust"],"backgroundTag":"corrupt-model-file","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}