Error code
SQLite SQLITE_CANTOPEN
SQLITESQLITE_CANTOPEN
Database Error Code· An error code returned by a database server such as PostgreSQL or MySQL.
What it means
unable to open the database file.
How to fix it
- Confirm the file path is correct and the parent directory exists and is accessible.
- Verify that the process has read (and write for a writable database) permission on the file and directory.
- Check for typos in the database path passed to sqlite3_open or the connection string.
Not affiliated with SQLite. Answer summarized from the manufacturer's manual linked above; consult that source for the authoritative procedure.
More SQLite codes
- SQLITE_AUTHauthorization denied — an authorizer callback blocked the operation
- SQLITE_BUSYdatabase file is locked — another connection holds a shared or reserved lock
- SQLITE_BUSY_SNAPSHOTWAL snapshot conflict — a snapshot-isolated read cannot see a newer WAL frame
- SQLITE_CONSTRAINTa constraint violation was raised — the write violates a database rule
- SQLITE_CONSTRAINT_FOREIGNKEYFOREIGN KEY constraint failed — the referenced row does not exist
- SQLITE_CONSTRAINT_UNIQUEUNIQUE constraint failed — a duplicate value was inserted
- SQLITE_CORRUPTthe database file is malformed — on-disk structure is damaged
- SQLITE_FULLthe database or disk is full — no space for the write
- SQLITE_IOERRan I/O error occurred on the disk
- SQLITE_LOCKEDa table in the database is locked — conflict within the same connection
- SQLITE_MISMATCHdatatype mismatch — the value type does not fit the affinity
- SQLITE_MISUSElibrary used incorrectly — the API was called in an invalid state