{"record":{"id":"54c29e6660874742","repo":"Zackriya-Solutions/meetily","slug":"failed-to-query-transcript-config","errorCode":null,"errorMessage":"Failed to query transcript config: {}","messagePattern":"Failed to query transcript config: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/audio/retranscription.rs","lineNumber":600,"sourceCode":"\n    let app_state = app\n        .try_state::<AppState>()\n        .ok_or_else(|| {\n            error!(\"App state not available\");\n            anyhow!(\"App state not available\")\n        })?;\n\n    debug!(\"Querying transcript_settings table...\");\n\n    // Query the transcript settings from the database - get both provider and model\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| {\n        error!(\"Failed to query transcript config: {}\", e);\n        anyhow!(\"Failed to query transcript config: {}\", e)\n    })?;\n\n    match result {\n        Some((provider, model)) => {\n            info!(\"Found transcript config: provider={}, model={}\", provider, model);\n\n            // Check if provider is Whisper-based\n            if provider == \"localWhisper\" || provider == \"whisper\" {\n                Ok(model)\n            } else {\n                error!(\"Retranscription requires Whisper provider, but configured provider is: {}\", provider);\n                Err(anyhow!(\"Retranscription requires Whisper. Current provider '{}' does not support retranscription with language selection.\", provider))\n            }\n        },\n        None => {\n            // Default to configured Whisper model if no config exists\n            warn!(\"No transcript config found, using default model '{}'\", DEFAULT_WHISPER_MODEL);\n            Ok(DEFAULT_WHISPER_MODEL.to_string())","sourceCodeStart":582,"sourceCodeEnd":618,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/audio/retranscription.rs#L582-L618","documentation":"The query SELECT provider, model FROM transcript_settings WHERE id = '1' itself errored. A missing row is NOT this error - the None arm handles that by defaulting the model; this error means the query execution failed: no transcript_settings table (schema/migration missing), the database is locked, or the file is corrupt.","triggerScenarios":"Database created without running migrations that create transcript_settings; another writer holds the SQLite lock at query time; corrupted DB file.","commonSituations":"App data directory from an older app version; first-run migration interrupted; a second app instance writing settings concurrently.","solutions":["Read the inner error: 'no such table: transcript_settings' means run the schema/migrations.","Pass an explicit model argument to start_retranscription - the config lookup is bypassed completely.","Retry when the database is not being written by another operation.","Recreate or restore the database if integrity checks fail."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Check the settings table exists and is readable before the batch job\nlet exists: i64 = sqlx::query_scalar(\n    \"SELECT COUNT(*) FROM sqlite_master WHERE type='table' AND name='transcript_settings'\"\n).fetch_one(pool).await.unwrap_or(0);\nif exists == 0 { /* run migrations or pass explicit model */ }","typeGuard":null,"tryCatchPattern":"// Distinguish missing schema (fix) from lock (retry)\nErr(e) if e.to_string().contains(\"no such table\") => fix_schema(),\nErr(e) if is_busy(&e) => retry_later(),\nErr(e) => propagate(e),","preventionTips":["Run migrations at startup so transcript_settings always exists.","Pass an explicit model argument to avoid depending on the settings row.","Avoid concurrent settings writes while retranscription resolves its model."],"tags":["sqlx","sqlite","query","configuration","schema-mismatch"],"backgroundTag":"sql-query-execution-failed","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}