MemPalace/mempalace · error · RebuildCollectionError

{exc}. The live collection '{collection_name}' was already r

Error message

{exc}. The live collection '{collection_name}' was already replaced and the re-upload into it failed. The fully-verified pre-swap copy survives under '{temp_name}' -- do NOT delete it. Recover by removing the broken '{collection_name}' collection and promoting '{temp_name}' in its place.

What it means

Error "{exc}. The live collection '{collection_name}' was already replaced and the re-upload into it failed. The fully-verified pre-swap copy survives under '{temp_name}' -- do NOT delete it. Recover by removing the broken '{collection_name}' collection and promoting '{temp_name}' in its place." thrown in MemPalace/mempalace.

Source

Thrown at mempalace/repair.py:402

        try:
            _delete_collection_if_exists(backend, palace_path, temp_name)
        except Exception:
            pass
        return rebuilt
    except Exception as exc:
        if not live_replaced:
            # The live collection was never touched -- the temp build is a
            # discardable in-progress copy, safe to clean up on failure.
            try:
                _delete_collection_if_exists(backend, palace_path, temp_name)
            except Exception:
                pass
            raise RebuildCollectionError(str(exc), live_replaced=live_replaced) from exc
        # The live collection was already deleted (line 294) before this
        # failure. `temp_name` is now the ONLY intact, verified copy of the
        # data left on disk -- never delete it here. Point the operator
        # at it instead of destroying the one thing that can still recover.
        raise RebuildCollectionError(
            f"{exc}. The live collection '{collection_name}' was already "
            f"replaced and the re-upload into it failed. The fully-verified "
            f"pre-swap copy survives under '{temp_name}' -- do NOT delete it. "
            f"Recover by removing the broken '{collection_name}' collection "
            f"and promoting '{temp_name}' in its place.",
            live_replaced=live_replaced,
        ) from exc


def _promote_temp_collection(
    backend,
    palace_path: str,
    temp_name: str,
    collection_name: str,
    expected: int,
    batch_size: int,
    progress=print,
) -> int:

View on GitHub (pinned to 06cb6987f0)

Solutions

  1. Remove the broken live collection and promote the surviving pre-swap temp copy in its place; do NOT delete the temp copy

When it happens

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

Common situations: Re-upload into the swapped collection failed after the original was already replaced.


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