SQLITE_READONLY_ROLLBACK: hot journal can't be rolled back
The database has a hot journal left by a crash that must be rolled back, but the connection can't write, so the database can't be opened.
- Result code
SQLITE_READONLY_ROLLBACK- Name
776- Category
- Extended result codes
What it means
SQLITE_READONLY_ROLLBACK (776) means the database file has a hot journal: a -journal file from a transaction that was interrupted by a crash. SQLite has to roll that journal back before anyone can read consistent data, and rolling back needs write access, which this connection doesn't have.
Common causes
- A program crashed mid-transaction, and the database is now being opened read-only or by a user without write permission.
- The database and its journal were copied to read-only media.
How to fix it
-
Open the database once with a user and mode that can write, so SQLite rolls the journal back; after that it can be opened read-only again.
-
Never delete the
-journalfile to get around this: it holds the data needed to undo the interrupted transaction, and deleting it can corrupt the database.
Related errors
SQLITE_READONLYattempt to write a readonly databaseSQLITE_CORRUPTdatabase disk image is malformed
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.