MemPalace/mempalace · error · RuntimeError

Drawer write was acknowledged but the new ID is not…

Error message

Drawer write was acknowledged but the new ID is not readable. The palace index may be stale; run reconnect or repair.

What it means

Error "Drawer write was acknowledged but the new ID is not readable. The palace index may be stale; run reconnect or repair." thrown in MemPalace/mempalace.

Solutions

  1. Run the reconnect or repair tool to rebuild the stale index

When it happens

Trigger: Thrown at mempalace/mcp_server.py:3002 when the library encounters an invalid state.

Common situations: Write succeeded but immediate read-back failed due to a stale palace index.


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

Appendix: source

Thrown at mempalace/mcp_server.py:3002

        idempotency_probe_ids = [drawer_id, f"{drawer_id}_chunk_{last_chunk_idx:06d}"]
    try:
        existing = col.get(ids=idempotency_probe_ids, include=[])
        if _get_result_ids(existing):
            return {"success": True, "reason": "already_exists", "drawer_id": drawer_id}
    except Exception as e:
        logger.warning("Idempotency pre-check failed for %s", idempotency_probe_ids, exc_info=True)
        return {"success": False, "error": f"Idempotency check failed before write: {e}"}

    try:
        if len(content) <= chunk_size:
            col.upsert(
                ids=[drawer_id],
                documents=[content],
                metadatas=[{**base_meta, "chunk_index": 0}],
            )
            inserted = col.get(ids=[drawer_id], include=[])
            if not _get_result_ids(inserted):
                raise RuntimeError(
                    "Drawer write was acknowledged but the new ID is not readable. "
                    "The palace index may be stale; run reconnect or repair."
                )
            _metadata_cache = None
            logger.info(f"Filed drawer: {drawer_id} -> {wing}/{room}")
            return {
                "success": True,
                "drawer_id": drawer_id,
                "wing": wing,
                "room": room,
                "chunks": 1,
            }

        # Oversized content: split into bounded per-chunk drawers so the
        # embedding model never sees a document above ``chunk_size``.
        # Single batched ``upsert`` so the embedding pass either commits
        # every chunk or none — no half-written palace if the embedding
        # model fails mid-loop (#1539).

View on GitHub (pinned to 06cb6987f0)