SQLITE_READONLY_DIRECTORY: can't create the journal file
The database file is writable but its directory isn't, so SQLite can't create the journal file it needs before writing.
- Result code
SQLITE_READONLY_DIRECTORY- Name
1544- Category
- Extended result codes
What it means
SQLITE_READONLY_DIRECTORY (1544) means the process lacks permission to create a journal file in the database's directory, and creating one is required before any write. This is the common case where a file has write permission but its folder does not.
Common causes
- The directory is owned by another user or is read-only, for example a system directory or an app bundle.
- A container volume mounted with a writable file but a read-only parent.
How to fix it
-
Give the process write permission on the directory, or move the database to a directory it owns.
-
In WAL mode the
-waland-shmfiles are created there too, so the directory must stay writable.
Related errors
More extended result codes errors
SQLITE_ERROR_MISSING_COLLSEQno such collation sequenceSQLITE_BUSY_RECOVERYanother process is recovering the WALSQLITE_LOCKED_SHAREDCACHErecord locked in shared cacheSQLITE_CONSTRAINT_CHECKCHECK constraint failedSQLITE_ABORT_ROLLBACKstatement aborted by ROLLBACKSQLITE_BUSY_SNAPSHOTstale read can't become a writeSQLITE_IOERR_SHORT_READread returned fewer bytesSQLITE_CANTOPEN_ISDIRthe path is a directory
The code and message text are from the SQLite result and error codes documentation. Browse the full SQLite error list or search every database error.
Work on SQLite in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for SQLite and the other databases you use.