SQLITE_IOERR_TRUNCATE
SQLiteFATALCriticalI/O Errorofficial confidence

I/O error during file truncation

Production Risk

Critical — database file may be left in an inconsistent size.

What this means

SQLITE_IOERR_TRUNCATE (1546) is returned when the OS reports an error during ftruncate() on the database or journal file. This can happen when freeing space after a transaction.

Why it happens
  1. 1Hardware failure during file truncation.
  2. 2Filesystem does not support ftruncate() (e.g., certain network filesystems).
  3. 3Insufficient permissions to modify file size.
How to reproduce

File truncation after a transaction commit or WAL checkpoint.

trigger — this will error
trigger — this will error
# Surfaces as disk I/O error during or after COMMIT

expected output

sqlite3.DatabaseError: disk I/O error

Fix 1

Fix 2

Fix 3

Sources
Official documentation ↗

sqlite3.h — SQLITE_IOERR_TRUNCATE = 1546

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

← All SQLite errors