Look up a SQLite error by its message: what it means, why it happens, read-only checks, safe fixes and examples reproduced with the SQLite library.
Common errors 5
CONSTRAINT
UNIQUE constraint failedA value already exists in a UNIQUE or PRIMARY KEY column (both use this message).
CONSTRAINT
FOREIGN KEY constraint failedA child row has no parent, or a parent still has children; find it with foreign_key_list and foreign_key_check.
BUSY
database is lockedAnother connection holds a lock on the file; busy timeouts, BEGIN IMMEDIATE, short transactions and WAL.
CORRUPT
database disk image is malformedThe database file is damaged: check a copy with integrity_check, then REINDEX, recover or restore a backup.
ERROR
no such tableThe table is not in the file this connection opened: often a wrong path that created a new empty database.
Constraint Violations 3
CONSTRAINT
UNIQUE constraint failedA value already exists in a UNIQUE or PRIMARY KEY column (both use this message).
CONSTRAINT
FOREIGN KEY constraint failedA child row has no parent, or a parent still has children; find it with foreign_key_list and foreign_key_check.
CONSTRAINT
NOT NULL constraint failedAn INSERT or UPDATE would store NULL in a NOT NULL column; a DEFAULT does not apply to an explicit NULL.
Files & Permissions 3
CANTOPEN
unable to open database fileMissing folder, a path that is a folder, no permission, or a read-only open of a missing file.
READONLY
attempt to write a readonly databaseThe connection, the file or its folder is read-only, or query_only is on; SQLite needs the folder for journal files.
NOTADB
file is not a databaseThe file has no valid SQLite header: CSV, HTML, Git LFS pointer, encrypted file or overwritten header.
No errors match. Press Search to search full messages, or browse every error.