SQLITE_IOERR_READ
SQLiteFATALCriticalI/O Errorofficial confidence

I/O error during file read

Production Risk

Critical — likely hardware failure; restore from backup.

What this means

SQLITE_IOERR_READ (266) is returned when the OS reports an error while reading from the database file. The data read may be incomplete or corrupt.

Why it happens
  1. 1Hardware failure (failing HDD/SSD).
  2. 2NFS or network filesystem disconnect mid-read.
  3. 3Filesystem corruption.
  4. 4Disk removed or unmounted while database was open.
How to reproduce

sqlite3_step() or any read operation when the OS read() syscall fails.

trigger — this will error
trigger — this will error
# SQLITE_IOERR_READ typically surfaces as:
# sqlite3.DatabaseError: disk I/O error

expected output

sqlite3.DatabaseError: disk I/O error

Fix 1

Fix 2

Fix 3

Fix 4

What not to do

Sources
Official documentation ↗

sqlite3.h — SQLITE_IOERR_READ = 266

SQLite I/O error codes

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All SQLite errors