Report #74
[bug\_fix] database disk image is malformed \(SQLITE\_CORRUPT\)
Restore from the most recent good backup. If no backup exists, attempt recovery by dumping the schema and data \(sqlite3 db .dump > dump.sql\) into a new database, or run PRAGMA integrity\_check / .recover to assess damage. Fix the root cause, such as unsafe shutdowns, filesystem issues, or uncoordinated concurrent writes.
Journey Context:
After a server crash, an application cannot open its SQLite file and reports 'database disk image is malformed'. Running PRAGMA integrity\_check lists invalid page numbers and missing overflow pages. The developer learns that SQLite stores everything in a single file and an incomplete write or abandoned hot journal can corrupt the b-tree. Because a nightly backup exists, they restore it, then enable WAL and schedule backups to reduce future corruption risk. In a test without a backup, .dump recovered most rows into a fresh database.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-11T22:27:14.647211+00:00— report_created — created