MemPalace/mempalace · error · FileNotFoundError

recovered palace has no SQLite database: {sqlite_path}

Error message

recovered palace has no SQLite database: {sqlite_path}

What it means

Error "recovered palace has no SQLite database: {sqlite_path}" thrown in MemPalace/mempalace.

Source

Thrown at mempalace/repair.py:1071

) -> None:
    """VACUUM the palace SQLite file and rebuild the FTS5 index if present.

    Repeated ``repair --yes`` runs delete and recreate the drawers collection,
    leaving freed SQLite pages unreclaimable without an explicit VACUUM.  The
    FTS5 virtual table (``embedding_fulltext_search``) can also become
    internally inconsistent after multiple collection deletes; the rebuild
    command fixes it atomically without touching any row data.

    Existing repair paths use the default best-effort behavior: failures log a
    warning and return because their primary rebuild has already succeeded.
    SQLite recovery passes ``strict=True`` because its bulk upserts can leave
    this derived index malformed; that path must not report success until the
    rebuild, VACUUM, and a final quick_check all complete.
    """
    sqlite_path = os.path.join(palace_path, "chroma.sqlite3")
    if not os.path.exists(sqlite_path):
        if strict:
            raise FileNotFoundError(f"recovered palace has no SQLite database: {sqlite_path}")
        return
    try:
        with closing(sqlite3.connect(sqlite_path, isolation_level=None)) as conn:
            tables = {
                r[0] for r in conn.execute("SELECT name FROM sqlite_master WHERE type='table'")
            }
            if "embedding_fulltext_search" in tables:
                conn.execute(
                    "INSERT INTO embedding_fulltext_search"
                    "(embedding_fulltext_search) VALUES('rebuild')"
                )
                conn.commit()
                progress("  FTS5 index rebuilt.")
            conn.execute("VACUUM")
            progress("  SQLite VACUUM complete.")
            if strict:
                rows = conn.execute("PRAGMA quick_check").fetchall()
                errors = [str(row[0]) for row in rows if row and str(row[0]).lower() != "ok"]

View on GitHub (pinned to 06cb6987f0)

Solutions

  1. Restore the SQLite database from backup before running repair

When it happens

Trigger: Thrown at mempalace/repair.py:1071 when the library encounters an invalid state.

Common situations: Recovered palace directory is missing its SQLite database.


AI-assisted analysis of MemPalace/mempalace@06cb6987f0 (2026-08-15). Data as JSON: /api/errors/25a9dd732be4aea6. Report an issue: GitHub.