{"record":{"id":"2979aba9cf036297","repo":"Zackriya-Solutions/meetily","slug":"failed-to-create-meeting","errorCode":null,"errorMessage":"Failed to create meeting: {}","messagePattern":"Failed to create meeting: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/audio/import.rs","lineNumber":717,"sourceCode":"    // Start transaction\n    let mut conn = pool.acquire().await.map_err(|e| anyhow!(\"DB error: {}\", e))?;\n    let mut tx = sqlx::Connection::begin(&mut *conn)\n        .await\n        .map_err(|e| anyhow!(\"Failed to start transaction: {}\", e))?;\n\n    // Insert meeting\n    sqlx::query(\n        \"INSERT INTO meetings (id, title, created_at, updated_at, folder_path)\n         VALUES (?, ?, ?, ?, ?)\",\n    )\n    .bind(&meeting_id)\n    .bind(title)\n    .bind(now)\n    .bind(now)\n    .bind(&folder_path)\n    .execute(&mut *tx)\n    .await\n    .map_err(|e| anyhow!(\"Failed to create meeting: {}\", e))?;\n\n    // Insert transcripts\n    for segment in segments {\n        sqlx::query(\n            \"INSERT INTO transcripts (id, meeting_id, transcript, timestamp, audio_start_time, audio_end_time, duration)\n             VALUES (?, ?, ?, ?, ?, ?, ?)\",\n        )\n        .bind(&segment.id)\n        .bind(&meeting_id)\n        .bind(&segment.text)\n        .bind(&segment.timestamp)\n        .bind(segment.audio_start_time)\n        .bind(segment.audio_end_time)\n        .bind(segment.duration)\n        .execute(&mut *tx)\n        .await\n        .map_err(|e| anyhow!(\"Failed to insert transcript: {}\", e))?;\n    }","sourceCodeStart":699,"sourceCodeEnd":735,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/audio/import.rs#L699-L735","documentation":"The INSERT INTO meetings failed inside the transaction; sqlx maps the SQLite result error into the {} — most often 'no such table: meetings' (migrations never ran on this database), a constraint violation (NOT NULL/UNIQUE), or an I/O error (disk full, read-only file). Because this happens inside the tx, all transcript inserts and the commit are skipped and the transaction rolls back when dropped.","triggerScenarios":"First import against a database created without migrations (older DB carried over, migration step skipped); a bound field ending up NULL; disk full or DB file read-only at first write; schema drift where the meetings table lacks expected columns.","commonSituations":"App updated with new schema but migrations failed silently at startup; user restored an old DB from backup; DB made read-only by backup tools; column renamed by a newer app version.","solutions":["Check the {} text — 'no such table' means migrations; 'constraint failed' names the violated column","Run and verify migrations at startup, then compare PRAGMA table_info(meetings) against the expected schema","Test the insert manually with the sqlite3 CLI against the same DB file to reproduce the exact error","Confirm the DB file and directory are writable and the disk has space"],"exampleFix":"// before — trust the schema blindly\nsqlx::query(\"INSERT INTO meetings (id, title, created_at, updated_at, folder_path) VALUES (?,?,?,?,?)\")\n    .execute(&mut *tx).await\n    .map_err(|e| anyhow!(\"Failed to create meeting: {}\", e))?;\n\n// after — fail fast with a precise cause and context\nlet res = sqlx::query(\n    \"INSERT INTO meetings (id, title, created_at, updated_at, folder_path) VALUES (?,?,?,?,?)\")\n    .bind(&meeting_id).bind(title).bind(now).bind(now).bind(&folder_path)\n    .execute(&mut *tx).await;\nif let Err(e) = res {\n    error!(\"meeting insert failed id={} folder={}: {}\", meeting_id, folder_path, e);\n    return Err(anyhow!(\"Failed to create meeting: {}\", e));\n}","handlingStrategy":"validation","validationCode":"-- run before import to catch schema drift\nSELECT name FROM sqlite_master WHERE type='table' AND name='meetings';\n-- then compare: PRAGMA table_info(meetings);","typeGuard":null,"tryCatchPattern":"On insert failure, log the sqlx error verbatim (it names the missing table or violated constraint) plus the meeting_id and folder_path, then roll back — do not retry constraint or schema errors, they are deterministic.","preventionTips":["Run sqlx migrations at app startup and fail loudly if they do not apply","Validate schema presence after app updates that change the meetings table","Check DB file writability and disk space before long imports"],"tags":["sqlx","sqlite","insert","schema-migration","meetings","rust"],"backgroundTag":"database-insert-failed","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}