SQLite Error Code Reference
Every significant SQLite result code explained — what it means, why it happens, and how to fix it. Python and CLI examples included for every entry.
⚙️ Error examples are AI-generated to help developers and are subject to the occasional error. Always verify against your specific version and setup.
SQL logic error
Generic Error
database is locked
Locking & Concurrency
database table is locked
Locking & Concurrency
attempt to write a readonly database
Access Control
disk I/O error
I/O Error
database disk image is malformed
Database Corruption
database or disk is full
Resource Limit
unable to open database file
File Access
database schema has changed
Schema
string or blob too big
Resource Limit
constraint failed
Constraint Violation
UNIQUE constraint failed (primary key)
Constraint Violation
UNIQUE constraint failed
Constraint Violation
FOREIGN KEY constraint failed
Constraint Violation
NOT NULL constraint failed
Constraint Violation
CHECK constraint failed
Constraint Violation
cannot start a transaction within a transaction (WAL snapshot conflict)
Locking & Concurrency
disk I/O error (write failure)
I/O Error
database disk image is malformed (virtual table)
Database Corruption
unable to open a temporary database file for storing temporary tables
File Access
attempt to write a readonly database (hot journal present)
Access Control
datatype mismatch
Type Error
bad parameter or other API misuse
API Misuse
not authorized
Access Control
file is not a database
File Access
Successful result
Success
Internal logic error in SQLite
Internal Error
Access permission denied
Permissions
Callback routine requested an abort
Transaction
malloc() failed — out of memory
Resource
Operation terminated by sqlite3_interrupt()
Control Flow
Unknown opcode or table/row not found
Not Found
Database locking protocol error
Locking
Internal use only (not used by SQLite)
Internal
Large file support is disabled
Filesystem
Auxiliary database format error (not used)
Internal
Bind or column index out of range
API Misuse
Notification from sqlite3_log()
Logging
Warning from sqlite3_log()
Logging
sqlite3_step() has another row ready
Step Result
sqlite3_step() finished executing
Step Result
Missing collating sequence
Collation
Statement aborted due to ROLLBACK
Transaction
Busy: another connection is recovering WAL
Locking
Busy: WAL snapshot is out of date
Locking
Busy: timeout waiting for lock
Locking
Locked due to shared-cache contention
Locking
Read-only: WAL recovery required by another connection
Read-Only
Read-only: unable to obtain shared lock
Read-Only
Read-only: rollback journal prevents read
Read-Only
Cannot open — path is a directory
File Access
Cannot open — full path resolution failed
File Access
Cannot open — symlinks not allowed
File Access
Virtual table content is corrupt
Corruption
sqlite_sequence table is corrupt
Corruption
Index is inconsistent with table
Corruption
CHECK constraint failed
Constraint
FOREIGN KEY constraint failed
Constraint
NOT NULL constraint failed
Constraint
PRIMARY KEY constraint failed
Constraint
UNIQUE constraint failed
Constraint
Rowid is not unique
Constraint
Strict table datatype constraint failed
Constraint
WAL file recovery in progress (log notice)
Logging
Hot journal rollback in progress (log notice)
Logging
Query using automatic index (log warning)
Performance
Extension loaded permanently into SQLite
Extension
I/O error during file read
I/O Error
I/O error: short read (unexpected EOF)
I/O Error
I/O error during file write
I/O Error
I/O error during fsync()
I/O Error
I/O error during file truncation
I/O Error
I/O error deleting journal file
I/O Error
I/O subsystem out of memory
I/O Error
I/O error obtaining file lock
I/O Error
I/O error during memory-mapped file access
I/O Error
I/O error starting atomic write
I/O Error
I/O error committing atomic write
I/O Error
I/O error rolling back atomic write
I/O Error
I/O error memory-mapping WAL shared memory
I/O Error
I/O error during file seek
I/O Error
I/O error deleting non-existent file
I/O Error
I/O error — filesystem is corrupt
I/O Error
Virtual table is locked
Locking
Read-only: database file has been moved
Read-Only
Read-only: unable to initialise shared memory
Read-Only
Read-only: journal directory is not writable
Read-Only
Commit hook requested rollback
Constraint
Constraint raised by a trigger
Constraint
Virtual table constraint violation
Constraint
Cannot delete a row required by a rowid scan
Constraint
Authorisation denied by user
Authorisation
File is a symlink (success with note)
File Access
Internal retry signal (not user-facing)
Internal
Snapshot is out of date
Snapshot
RBU update notice from sqlite3_log()
Logging
I/O error: data integrity check failed
I/O Error
I/O error syncing the journal directory
I/O Error
I/O error releasing file lock
I/O Error
I/O error checking reserved read lock
I/O Error
I/O error checking file existence/access
I/O Error
I/O error closing file descriptor
I/O Error
I/O error opening WAL shared-memory file
I/O Error
I/O error resizing WAL shared-memory file
I/O Error
I/O error finding a temporary directory
I/O Error
About This Reference
This SQLite error code reference covers 25 of the most common result codes encountered when building applications with SQLite. Each entry includes the numeric result code from sqlite3.h, a Python trigger example, a verified fix with mechanism explanation, and sources from the official SQLite documentation. Extended result codes (such as SQLITE_CONSTRAINT_UNIQUE and SQLITE_BUSY_SNAPSHOT) are covered alongside their base codes.