// SQLite error reference

SQLITE_CORRUPT_INDEX: index entry missing

SQLite found an index that is missing an entry for a row. Running REINDEX may repair it, if nothing else in the file is damaged.

Result code
SQLITE_CORRUPT_INDEX
Name
779
Category
Extended result codes
Error message
database disk image is malformed

What it means

SQLITE_CORRUPT_INDEX (779) is a special case of SQLITE_CORRUPT: an entry is or was missing from an index. Because indexes can be rebuilt from their tables, the SQLite documentation notes that REINDEX may fix the problem as long as there is no other damage.

A common cause is changing a collation or a function used by an index (for example after upgrading an extension) so that existing index entries no longer sort the way SQLite expects.

Common causes

  • A custom collation or deterministic function used by an index changed its behavior.
  • General file damage that happened to hit an index page.

How to fix it

  1. Rebuild the indexes, then check the whole file.

    REINDEX;
    PRAGMA integrity_check;
  2. If the integrity check still reports problems, treat it as SQLITE_CORRUPT: copy the file and recover with .recover.

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.