// SQLite error reference

SQLITE_BUSY_TIMEOUT: blocking file lock timed out

A blocking POSIX file lock request in SQLite's VFS layer timed out. Only builds compiled with SQLITE_ENABLE_SETLK_TIMEOUT return it.

Result code
SQLITE_BUSY_TIMEOUT
Name
773
Category
Extended result codes
Error message
database is locked

What it means

The SQLite documentation describes SQLITE_BUSY_TIMEOUT (773) as a blocking POSIX advisory file lock request that failed because of a timeout. Blocking locks are only used when SQLite is compiled with SQLITE_ENABLE_SETLK_TIMEOUT, so most applications never see this code; they get plain SQLITE_BUSY when a lock can't be taken.

Common causes

  • Another connection held the lock for longer than the configured wait, on a build that uses blocking locks.

How to fix it

  1. Handle it like SQLITE_BUSY: keep write transactions short, use WAL mode, and retry.

  2. Raise the wait time if the lock holder is expected to take a while.

    PRAGMA busy_timeout = 10000;

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.