Common Local DB Failures

SymptomLikely causeFix
app crashes after updatemissing migration pathadd migration from old version and test with fixture
data disappeared after upgradedestructive migration ranrestore backup, remove fallback for user data
backup misses latest rowscopied .db without WALuse online backup API or VACUUM INTO
database is lockedlong transaction or another processshorten transactions, close readers, add timeout/retry
restore opens but data is wrongimported unsupported version or partial filesvalidate manifest, schema, checksums, and row counts
search results stalederived index not rebuiltrebuild index from source data after import/migration
browser write failsquota exceededshow cleanup/export UX and request persistent storage
IndexedDB upgrade hangsold tab holds DB connectionprompt reload/close other tabs

SQLite Triage

PRAGMA database_list;
PRAGMA integrity_check;
PRAGMA foreign_key_check;
PRAGMA journal_mode;

Room Triage

  • confirm the installed app version and DB version
  • check exported schema history
  • reproduce with an old fixture DB
  • assert migration preserved representative rows
  • inspect the device DB with Android Studio Database Inspector or adb shell sqlite3

Browser Triage

  • reproduce in a clean browser profile
  • test private mode separately
  • check storage estimate and persistence status
  • test with another tab holding the old DB version