SQLITE_IOERR_CLOSE
SQLiteWARNINGNotableI/O Errorofficial confidence

I/O error closing file descriptor

Production Risk

Medium — indicates possible write-back failure; check disk.

What this means

SQLITE_IOERR_CLOSE (4106) is returned when close() on a database-related file descriptor returns an error. On Linux, close() errors are rare but may indicate a write-back failure.

Why it happens
  1. 1OS write-back error on close() (Linux: EIO flushing dirty pages).
  2. 2File descriptor already closed (double-close bug in VFS).
How to reproduce

SQLite connection close when the OS close() syscall fails.

trigger — this will error
trigger — this will error
# Surfaces when closing database connection
conn.close()  # may raise OperationalError in some drivers

expected output

sqlite3.OperationalError: disk I/O error

Fix 1

Fix 2

Sources
Official documentation ↗

sqlite3.h — SQLITE_IOERR_CLOSE = 4106

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

← All SQLite errors