MemPalace/mempalace · error · TruncationDetected

ABORT: chroma.sqlite3 reports {sqlite_count:,} drawers bu

Error message

  ABORT: chroma.sqlite3 reports {sqlite_count:,} drawers but only {extracted:,}
  came back through the chromadb collection layer. The segment metadata is
  stale (often after manual HNSW quarantine) — proceeding would silently
  destroy {loss:,} drawers (~{pct:.0f}%).

  Recovery options:
    1. Restore from your most recent palace backup, then re-mine.
    2. Direct-extract from chroma.sqlite3 (rows are still on disk) and
       rebuild the palace from source files.
    3. If you have independently confirmed the palace really contains only
       {extracted:,} drawers, re-run with --confirm-truncation-ok.

What it means

Error " ABORT: chroma.sqlite3 reports {sqlite_count:,} drawers but only {extracted:,} came back through the chromadb collection layer. The segment metadata is stale (often after manual HNSW quarantine) — proceeding would silently destroy {loss:,} drawers (~{pct:.0f}%). Recovery options: 1. Restore from your most recent palace backup, then re-mine. 2. Direct-extract from chroma.sqlite3 (rows are still on disk) and rebuild the palace from source files. 3. If you have independently confirmed the palace really contains only {extracted:,} drawers, re-run with --confirm-truncation-ok. " thrown in MemPalace/mempalace.

Source

Thrown at mempalace/repair.py:674

    cap_signal = extracted == CHROMADB_DEFAULT_GET_LIMIT

    if sqlite_count is not None and sqlite_count > extracted:
        loss = sqlite_count - extracted
        pct = 100 * loss / sqlite_count
        message = (
            f"\n  ABORT: chroma.sqlite3 reports {sqlite_count:,} drawers but only {extracted:,}\n"
            "  came back through the chromadb collection layer. The segment metadata is\n"
            "  stale (often after manual HNSW quarantine) — proceeding would silently\n"
            f"  destroy {loss:,} drawers (~{pct:.0f}%).\n"
            "\n"
            "  Recovery options:\n"
            "    1. Restore from your most recent palace backup, then re-mine.\n"
            "    2. Direct-extract from chroma.sqlite3 (rows are still on disk) and\n"
            "       rebuild the palace from source files.\n"
            "    3. If you have independently confirmed the palace really contains only\n"
            f"       {extracted:,} drawers, re-run with --confirm-truncation-ok.\n"
        )
        raise TruncationDetected(message, sqlite_count, extracted)

    if cap_signal and sqlite_count is None:
        message = (
            f"\n  ABORT: extracted exactly {CHROMADB_DEFAULT_GET_LIMIT:,} drawers, which matches\n"
            "  ChromaDB's internal default get() limit. The on-disk SQLite count couldn't\n"
            "  be cross-checked from this Python context, so we can't tell whether the\n"
            f"  palace genuinely holds {CHROMADB_DEFAULT_GET_LIMIT:,} rows or whether extraction was\n"
            "  silently capped. Refusing to overwrite the palace.\n"
            "\n"
            "  If you have independently confirmed (e.g. via direct sqlite3 query) that\n"
            f"  the palace really contains exactly {CHROMADB_DEFAULT_GET_LIMIT:,} drawers, re-run with\n"
            "  --confirm-truncation-ok.\n"
        )
        raise TruncationDetected(message, sqlite_count, extracted)


def sqlite_drawer_count(palace_path: str, collection_name: Optional[str] = None) -> "int | None":
    """Count rows in ``chroma.sqlite3.embeddings`` for the drawers collection.

View on GitHub (pinned to 06cb6987f0)

Solutions

  1. Restore from backup and re-mine, direct-extract from chroma.sqlite3, or re-run with --confirm-truncation-ok if the count is confirmed correct

When it happens

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

Common situations: Stale segment metadata hid most drawers; extraction would have silently destroyed them.


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