{"record":{"id":"c5667fc50555f557","repo":"Zackriya-Solutions/meetily","slug":"model-not-found-c5667f","errorCode":null,"errorMessage":"Model '{}' not found","messagePattern":"Model '(.+?)' not found","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"frontend/src-tauri/src/whisper_engine/whisper_engine.rs","lineNumber":841,"sourceCode":"        if buffer.starts_with(b\"ggml\") || buffer.starts_with(b\"GGUF\") || buffer.starts_with(b\"ggmf\") ||\n           buffer.starts_with(b\"lmgg\") || buffer.starts_with(b\"FUGU\") || buffer.starts_with(b\"fmgg\") {\n            Ok(())\n        } else {\n            Err(anyhow!(\"Invalid model file: missing GGML/GGUF magic number. Found: {:?}\",\n                       String::from_utf8_lossy(&buffer[..4])))\n        }\n    }\n\n    pub async fn delete_model(&self, model_name: &str) -> Result<String> {\n        log::info!(\"Attempting to delete model: {}\", model_name);\n\n        // Get model info to find the file path\n        let model_info = {\n            let models = self.available_models.read().await;\n            models.get(model_name).cloned()\n        };\n\n        let model_info = model_info.ok_or_else(|| anyhow!(\"Model '{}' not found\", model_name))?;\n\n        // Check if model is corrupted before allowing deletion\n        log::info!(\"Model '{}' has status: {:?}\", model_name, model_info.status);\n        match &model_info.status {\n            ModelStatus::Corrupted { file_size, expected_min_size } => {\n                log::info!(\"Deleting corrupted model '{}' (file size: {} bytes, expected min: {} bytes)\",\n                          model_name, file_size, expected_min_size);\n\n                // Delete the file\n                if model_info.path.exists() {\n                    fs::remove_file(&model_info.path).await\n                        .map_err(|e| anyhow!(\"Failed to delete file '{}': {}\", model_info.path.display(), e))?;\n                    log::info!(\"Successfully deleted corrupted file: {}\", model_info.path.display());\n                } else {\n                    log::warn!(\"File '{}' does not exist, nothing to delete\", model_info.path.display());\n                }\n\n                // Update model status to Missing","sourceCodeStart":823,"sourceCodeEnd":859,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/whisper_engine/whisper_engine.rs#L823-L859","documentation":"delete_model looks up model_name in the in-memory available_models registry and this error is thrown when the key is absent. It is a pure registry lookup failure — no file operation is attempted. Names are exact, case-sensitive catalog keys.","triggerScenarios":"Calling delete_model with a typo'd or case-mismatched name ('Base' vs 'base'); using a display label instead of the model id; calling delete before the model registry has been scanned/initialized.","commonSituations":"Frontend list out of sync with the Rust catalog (e.g. 'base-q5' vs the real key 'base-q5_1'); stale reference after the catalog changed between versions; assuming arbitrary file names in the models dir are deletable by name.","solutions":["Call get_models / list_models first and pass the exact id string from the registry","Use exact catalog keys: tiny, base, small, medium, large-v3-turbo, large-v3, tiny-q5_1, base-q5_1, small-q5_1, medium-q5_0, large-v3-turbo-q5_0, large-v3-q5_0","For a custom ggml file not in the catalog, delete ggml-<name>.bin from the models directory manually"],"exampleFix":"// before\nawait invoke('delete_model', { modelName: 'Base' }); // 'not found'\n\n// after\nconst models = await invoke<ModelInfo[]>('get_whisper_models');\nconst target = models.find(m => m.name.toLowerCase() === 'base');\nif (target) await invoke('delete_model', { modelName: target.name });","handlingStrategy":"validation","validationCode":"const models = await invoke<ModelInfo[]>('get_whisper_models');\nconst exists = models.some(m => m.name === modelName);\nif (!exists) throw new Error(`Unknown model '${modelName}'. Known: ${models.map(m => m.name).join(', ')}`);\nawait invoke('delete_model', { modelName });","typeGuard":"const isKnownModel = (name: string, models: ModelInfo[]): boolean =>\n  models.some(m => m.name === name);","tryCatchPattern":"try {\n  await invoke('delete_model', { modelName });\n} catch (e) {\n  if (String(e).includes('not found')) { refreshModelList(); } else { throw e; }\n}","preventionTips":["Always source model ids from get_whisper_models, never hardcode strings in the UI","Keep the frontend catalog and the Rust URL match arm in one shared list when possible","Model keys are case-sensitive: pass machine ids, not display labels"],"tags":["whisper","model-management","validation","rust","tauri"],"backgroundTag":"invalid-model-identifier","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}