SQLITE_READONLY_DIRECTORY
SQLiteERRORNotableRead-Onlyofficial confidence
Read-only: journal directory is not writable
Production Risk
High — all writes fail; journal files cannot be created.
What this means
SQLITE_READONLY_DIRECTORY (1544) is returned when the database file itself is writable but the directory containing it is not, preventing creation of the journal or WAL sidecar files.
Why it happens
- 1Database file is writable but the parent directory is not (e.g., group permissions missing on directory).
- 2Docker volume: file permissions differ from directory permissions.
How to reproduce
First write to a database where the directory is not writable.
trigger — this will error
trigger — this will error
import os, sqlite3
os.chmod('/data/', 0o555) # directory read/execute only
conn = sqlite3.connect('/data/my.db')
try:
conn.execute('CREATE TABLE t(x)')
except sqlite3.OperationalError as e:
print(e) # attempt to write a readonly databaseexpected output
sqlite3.OperationalError: attempt to write a readonly database
Fix 1
Fix 2
Version notes
Sources
Official documentation ↗
sqlite3.h — SQLITE_READONLY_DIRECTORY = 1544
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev