// SQLite error reference

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
Error message
attempt to write a readonly database

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

  1. Give the process write permission on the directory, or move the database to a directory it owns.

  2. In WAL mode the -wal and -shm files are created there too, so the directory must stay writable.

Related errors

More extended result codes errors

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.

// fewer errors, faster fixes

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.