Report #102931
[bug\_fix] SQLite: database is locked
Enable WAL mode with PRAGMA journal\_mode=WAL, set PRAGMA busy\_timeout=5000, and serialize all writes through a single long-lived connection or writer queue. WAL allows one writer while readers proceed, and busy\_timeout lets writers wait briefly instead of failing.
Journey Context:
Your asyncio bot uses aiosqlite and many tasks commit small updates. Intermittently you get sqlite3.OperationalError: database is locked. You read the SQLite docs and learn the default rollback journal locks the whole database file during writes. You enable WAL, set a busy timeout, and funnel all writes through one asyncio Queue worker. Lock errors stop because WAL isolates readers from the writer and writers wait politely.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-10T04:43:42.165302+00:00— report_created — created