Report #43637
[bug\_fix] attempt to write a readonly database \(SQLITE\_READONLY\)
Ensure the directory containing the database file is writable \(SQLite needs to create journal files in the same directory\), check filesystem permissions, and for container/serverless environments, ensure the database is on a writable volume \(not read-only rootfs\).
Journey Context:
Deployed a Python Flask app to AWS Lambda using SQLite for a small read-heavy cache. Packaged the .db file in the deployment zip. On first write attempt, got 'attempt to write a readonly database'. Checked permissions: file was 644. Realized Lambda's /var/task is read-only. The SQLite journal file \(-journal or -wal\) must be created in the same directory as the database, which was impossible. Fix was to copy the database to /tmp \(writable\) on Lambda cold start, then connect to /tmp/cache.db. For Docker, ensure the volume mount allows writes to the directory, not just the file.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T03:43:00.740422+00:00— report_created — created