SQLITE_IOERR_WRITE
SQLiteFATALCriticalI/O Errorofficial confidence

I/O error during file write

Production Risk

Critical — database may be corrupt after a partial write.

What this means

SQLITE_IOERR_WRITE (778) is returned when the OS reports an error during a write to the database file. The write may have been partial, leaving the database in an inconsistent state.

Why it happens
  1. 1Disk full (ENOSPC).
  2. 2Hardware failure during write.
  3. 3Network filesystem disconnect.
  4. 4Read-only filesystem.
How to reproduce

Any write transaction when the OS write() syscall fails.

trigger — this will error
trigger — this will error
# Check disk space:
# df -h /path/to/database

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_WRITE = 778

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

← All SQLite errors