{"record":{"id":"25bd048866555b51","repo":"Hmbown/CodeWhale","slug":"failed-to-enable-wal-for-sqlite-retained-journ","errorCode":null,"errorMessage":"failed to enable WAL for {}: SQLite retained journal mode {configured_mode}","messagePattern":"failed to enable WAL for (.+?): SQLite retained journal mode (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/state/src/lib.rs","lineNumber":337,"sourceCode":"        conn.busy_timeout(std::time::Duration::from_secs(5))\n            .with_context(|| format!(\"failed to set busy_timeout for {}\", db_path.display()))?;\n        conn.pragma_update(None, \"foreign_keys\", \"ON\")\n            .with_context(|| format!(\"failed to enable foreign keys for {}\", db_path.display()))?;\n\n        // WAL persists in the database header, so established stores need no\n        // write-like journal transition on every process start. Fresh or\n        // explicitly downgraded stores still transition once, and we verify\n        // SQLite accepted the requested mode instead of silently retaining the\n        // previous one (for example on an unsupported VFS).\n        let journal_mode: String = conn\n            .pragma_query_value(None, \"journal_mode\", |row| row.get(0))\n            .with_context(|| format!(\"failed to read journal mode for {}\", db_path.display()))?;\n        if !journal_mode.eq_ignore_ascii_case(\"wal\") {\n            let configured_mode: String = conn\n                .pragma_update_and_check(None, \"journal_mode\", \"WAL\", |row| row.get(0))\n                .with_context(|| format!(\"failed to enable WAL for {}\", db_path.display()))?;\n            if !configured_mode.eq_ignore_ascii_case(\"wal\") {\n                anyhow::bail!(\n                    \"failed to enable WAL for {}: SQLite retained journal mode {configured_mode}\",\n                    db_path.display()\n                );\n            }\n        }\n        Ok(())\n    }\n\n    /// Returns the filesystem path of the underlying SQLite database.\n    pub fn db_path(&self) -> &Path {\n        &self.db_path\n    }\n\n    fn conn(&self) -> Result<MutexGuard<'_, Connection>> {\n        // Poisoning means a panic mid-operation; any open transaction was\n        // rolled back when it dropped, but surface the condition rather than\n        // silently continuing on a connection whose state we can't vouch for.\n        self.conn","sourceCodeStart":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/state/src/lib.rs#L319-L355","documentation":"Error \"failed to enable WAL for {}: SQLite retained journal mode {configured_mode}\" thrown in Hmbown/CodeWhale.","triggerScenarios":"Thrown at crates/state/src/lib.rs:337 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}