pgref.dev/sqlite/errors/SQLITE_IOERR_SEEK
SQLITE_IOERR_SEEKFATALTier 3 — Handle with care⚠️ MEDIUM confidence

I/O error during file seek

Category: I/O ErrorVersions: 3.0+

🔴 Production Risk Error

Critical — hardware failure; restore from backup.

What this means

SQLITE_IOERR_SEEK (5642) is returned when the OS reports an error during an lseek() call on the database file. Usually indicates a hardware or filesystem failure.

Why it happens

  1. 1Hardware failure on the storage device.
  2. 2File offset exceeds device capacity.
  3. 3Filesystem corruption.

How to reproduce

Random-access reads and writes that use lseek() to position the file cursor.

trigger — this will ERROR
# Triggered by hardware failure; surfaces as:
# sqlite3.DatabaseError: disk I/O error
sqlite3.DatabaseError: disk I/O error

Fix 1

Why this works

Check disk health with SMART diagnostics.

Fix 2

Why this works

Run filesystem check (fsck).

Fix 3

Why this works

Restore database from backup.

Sources

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

🔧 Source ref: sqlite3.h — SQLITE_IOERR_SEEK = 5642

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 →