{"record":{"id":"61707773bcd83241","repo":"Zackriya-Solutions/meetily","slug":"parakeet-engine-not-initialized","errorCode":null,"errorMessage":"Parakeet engine not initialized","messagePattern":"Parakeet engine not initialized","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/audio/import.rs","lineNumber":838,"sourceCode":"\n            if needs_load {\n                info!(\n                    \"Loading Parakeet model '{}' (current: {:?})\",\n                    target_model, current_model\n                );\n\n                if let Err(e) = e.discover_models().await {\n                    warn!(\"Model discovery error (continuing): {}\", e);\n                }\n\n                e.load_model(&target_model)\n                    .await\n                    .map_err(|e| anyhow!(\"Failed to load model '{}': {}\", target_model, e))?;\n            }\n\n            Ok(e)\n        }\n        None => Err(anyhow!(\"Parakeet engine not initialized\")),\n    }\n}\n\n/// Get the configured model from database\nasync fn get_configured_model<R: Runtime>(app: &AppHandle<R>, provider_type: &str) -> Result<String> {\n    let app_state = app\n        .try_state::<AppState>()\n        .ok_or_else(|| anyhow!(\"App state not available\"))?;\n\n    let result: Option<(String, String)> = sqlx::query_as(\n        \"SELECT provider, model FROM transcript_settings WHERE id = '1'\",\n    )\n    .fetch_optional(app_state.db_manager.pool())\n    .await\n    .map_err(|e| anyhow!(\"Failed to query config: {}\", e))?;\n\n    match result {\n        Some((provider, model)) => {","sourceCodeStart":820,"sourceCodeEnd":856,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/audio/import.rs#L820-L856","documentation":"get_or_init_parakeet found the process-global PARAKEET_ENGINE static empty — no parakeet engine was ever constructed in this app session — so a parakeet-provider import cannot proceed. Like its whisper twin, this getter only reads the global; it does not initialize despite its name.","triggerScenarios":"Import with provider == 'parakeet' and >0 speech segments before any parakeet engine initialization has run; the parakeet feature not compiled into the build; an earlier init attempt failed and left the global unset.","commonSituations":"User selects the parakeet provider and imports immediately on a fresh start; parakeet support disabled or not bundled in the installed build; tests invoking import without engine setup.","solutions":["Initialize the parakeet engine (its init/load command or the provider settings flow) before import, or at app start when parakeet is the selected provider","Verify the parakeet feature is compiled into this build (Cargo features / bundled artifacts)","Make the getter lazily construct the engine when None","Fall back to the whisper provider for the import if parakeet is unavailable in this session"],"exampleFix":"// before — None is a dead end\nmatch engine {\n    Some(e) => Ok(e),\n    None => Err(anyhow!(\"Parakeet engine not initialized\")),\n}\n\n// after — initialize on miss\nlet engine = match engine {\n    Some(e) => e,\n    None => {\n        let e = Arc::new(ParakeetEngine::new());\n        *PARAKEET_ENGINE.lock().unwrap_or_else(|x| x.into_inner()) = Some(e.clone());\n        e\n    }\n};","handlingStrategy":"validation","validationCode":"// ensure the parakeet engine exists before a parakeet import\nuse crate::parakeet_engine::commands::PARAKEET_ENGINE;\nlet ready = PARAKEET_ENGINE\n    .lock()\n    .map(|g| g.is_some())\n    .unwrap_or(false);\nif !ready { initialize_parakeet_engine(&app).await?; }","typeGuard":"fn parakeet_engine_ready() -> bool {\n    use crate::parakeet_engine::commands::PARAKEET_ENGINE;\n    PARAKEET_ENGINE.lock().map(|g| g.is_some()).unwrap_or(false)\n}","tryCatchPattern":"Unretryable at the call site: catch it, run the parakeet engine initialization, then restart the import — or catch it in the frontend and re-invoke start_import with provider 'whisper' as an immediate fallback.","preventionTips":["Initialize the parakeet engine when the user selects it in provider settings, not lazily at import time","Confirm the parakeet feature is compiled into the shipped build","Do not rely on the 'get_or_init' name — the function never initializes"],"tags":["parakeet","initialization","global-state","tauri","rust"],"backgroundTag":"engine-not-initialized","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}