Report #15888
[bug\_fix] SQLite WAL file unbounded growth \(-wal file filling disk\)
Ensure no long-running transactions hold back the checkpoint; run PRAGMA wal\_checkpoint\(TRUNCATE\) during maintenance, or enable auto-checkpoint with PRAGMA wal\_autocheckpoint=1000. Root cause: SQLite cannot checkpoint \(move WAL contents back to main db\) while any transaction is open; long-lived connections prevent checkpointing causing -wal file to grow indefinitely.
Journey Context:
Noticed the SQLite database file was 50MB but the accompanying -wal file had grown to 12GB, consuming all disk space. Application was performing millions of writes successfully but the -wal file never shrank. Investigated and found one background worker process had started a transaction 5 days ago and never committed it. Because SQLite requires all transactions to see a consistent snapshot, it could not checkpoint any pages newer than that 5-day-old transaction start time. Killed the rogue connection, ran PRAGMA wal\_checkpoint\(TRUNCATE\), and implemented monitoring to detect transactions older than 1 hour. The -wal file shrank to 4KB instantly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T01:18:29.553595+00:00— report_created — created