SQLITE_IOERR: disk I/O error
The operating system reported an I/O error while SQLite read, wrote, synced or locked a file. The extended code says which operation failed.
- Result code
SQLITE_IOERR- Name
10- Category
- Primary result codes
What it means
SQLITE_IOERR (10) means a file operation failed at the operating-system level. SQLite has many extended codes for it, such as SQLITE_IOERR_READ, SQLITE_IOERR_WRITE, SQLITE_IOERR_FSYNC, SQLITE_IOERR_SHORT_READ (fewer bytes than requested, for example a truncated file) and SQLITE_IOERR_LOCK. A full disk normally gives SQLITE_FULL instead.
The extended code is the best clue, so enable extended result codes or read them with sqlite3_extended_errcode().
Common causes
- Failing or disconnected storage: a removed USB drive, an unmounted network share, a bad disk.
- A network file system or sync folder that doesn't support the locking or syncing SQLite needs.
- Antivirus or backup software holding or changing the file.
- The file was truncated or replaced underneath an open connection.
How to fix it
-
Read the extended code to see which operation failed, and check the operating system's logs for disk errors.
-
Keep the database on a local disk. If it must be shared, don't share the file: put a server in front of it.
-
Exclude the database,
-journal,-waland-shmfiles from antivirus scanning and file-sync tools. -
After any I/O error, check the file before trusting it.
PRAGMA integrity_check;
Related errors
SQLITE_FULLdatabase or disk is fullSQLITE_CORRUPTdatabase disk image is malformedSQLITE_IOERR_SHORT_READread returned fewer bytesSQLITE_CANTOPENunable to open database file823SQL Server: Operating system returned an I/O error
More primary result codes errors
SQLITE_ERRORSQL logic errorSQLITE_PERMaccess permission deniedSQLITE_ABORTquery abortedSQLITE_BUSYdatabase is lockedSQLITE_LOCKEDdatabase table is lockedSQLITE_NOMEMout of memorySQLITE_READONLYattempt to write a readonly databaseSQLITE_INTERRUPTinterrupted
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.