SQLITE_BUSY_RECOVERY: another process is recovering the WAL
Another process is recovering a WAL-mode database after a crash, so this connection has to wait. It clears once recovery finishes.
- Result code
SQLITE_BUSY_RECOVERY- Name
261- Category
- Extended result codes
What it means
SQLITE_BUSY_RECOVERY (261) is an extended SQLITE_BUSY code for WAL-mode databases: an operation couldn't continue because another process is busy recovering the database file after a crash. Recovery rebuilds the WAL index from the WAL file and normally takes a moment.
Common causes
- A process using the database crashed or was killed, and the next connection is recovering the WAL.
- A very large WAL file, which makes recovery take longer.
How to fix it
-
Retry after a short wait, or set a busy timeout so SQLite waits for you.
PRAGMA busy_timeout = 5000;
-
Keep the WAL small with regular checkpoints, so recovery after a crash is quick.
PRAGMA wal_checkpoint(TRUNCATE);
Related errors
More extended result codes errors
SQLITE_ERROR_MISSING_COLLSEQno such collation sequenceSQLITE_LOCKED_SHAREDCACHErecord locked in shared cacheSQLITE_CONSTRAINT_CHECKCHECK constraint failedSQLITE_ABORT_ROLLBACKstatement aborted by ROLLBACKSQLITE_IOERR_SHORT_READread returned fewer bytesSQLITE_CANTOPEN_ISDIRthe path is a directorySQLITE_BUSY_TIMEOUTblocking file lock timed outSQLITE_READONLY_ROLLBACKhot journal can't be rolled back
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.