Report #86978
[bug\_fix] attempt to write a readonly database \(SQLITE\_READONLY\)
Ensure the database file, its directory, and any WAL sidecar files \(-wal, -shm\) are writable by the OS user running the process. Check for read-only filesystem mounts \(common in Docker with :ro or in serverless /tmp-only environments\), and make sure the connection is not opened in readonly mode.
Journey Context:
A Django app runs fine locally but throws 'attempt to write a readonly database' in production. The developer verifies the SQLite file itself is 644 and owned by www-data, but misses that the containing directory is owned by root and SQLite needs to create journal files there. After chowning the directory, writes succeed. In a later container deployment the same error appears because the volume was mounted read-only; moving the database to a writable path or copying it to /tmp at startup fixes it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T04:34:46.980110+00:00— report_created — created