// SQLite error reference

SQLITE_IOERR_SHORT_READ: read returned fewer bytes

A read in SQLite's VFS layer got fewer bytes than it asked for, which usually means the database file is truncated.

Result code
SQLITE_IOERR_SHORT_READ
Name
522
Category
Extended result codes
Error message
disk I/O error

What it means

SQLITE_IOERR_SHORT_READ (522) is an extended SQLITE_IOERR code: a read couldn't get as many bytes as requested. The SQLite documentation names a truncated file as a likely cause, for example from an incomplete copy or download.

Common causes

  • The file was truncated by an interrupted copy, download or sync.
  • Another process truncated or replaced the file while it was open.

How to fix it

  1. Compare the file's size with the original or with a backup, and re-copy it.

  2. Check what can still be read, and recover into a new file if needed.

    PRAGMA integrity_check;

Related errors

More extended result codes errors

The code and message text are from the SQLite result and error codes documentation. Browse the full SQLite error list or search every database error.

// fewer errors, faster fixes

Work on SQLite in SQLly

A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for SQLite and the other databases you use.