pgref.dev/sqlite/errors/SQLITE_IOERR_ROLLBACK_ATOMIC
SQLITE_IOERR_ROLLBACK_ATOMICFATALTier 3 — Handle with care⚠️ MEDIUM confidence

I/O error rolling back atomic write

Category: I/O ErrorVersions: 3.25.0+

🔴 Production Risk Error

Critical — database state is unknown.

What this means

SQLITE_IOERR_ROLLBACK_ATOMIC (7946) is returned when the VFS cannot roll back a failed atomic write. The database state is unknown and may require recovery or restore.

Why it happens

  1. 1Hardware failure during atomic rollback.
  2. 2VFS error aborting the atomic write batch.

How to reproduce

ROLLBACK on a database using atomic write VFS after another error.

trigger — this will ERROR
# Occurs when ROLLBACK itself fails on an atomic-write VFS
# → indeterminate database state
sqlite3.DatabaseError: disk I/O error

Fix 1

Why this works

Check disk hardware immediately.

Fix 2

Why this works

Treat the database as suspect — run integrity_check before further use.

Fix 3

Why this works

Restore from the most recent backup.

What not to do

Why it's wrong:

Sources

📚 Official docs: https://www.sqlite.org/rescode.html#ioerr_rollback_atomic

🔧 Source ref: sqlite3.h — SQLITE_IOERR_ROLLBACK_ATOMIC = 7946

Confidence assessment

⚠️ MEDIUM confidence

Stable.

See also

⚙️ This error reference was generated with AI assistance and reviewed for accuracy. Examples are provided to illustrate common scenarios and may not cover every case. Always test fixes in a development environment before applying to production. Spotted an error? Suggest a correction →