MemPalace/mempalace · error · BackendMismatchError

palace at {palace_path!r} contains {detected!r} backend arti

Error message

palace at {palace_path!r} contains {detected!r} backend artifacts, but {selected!r} was selected

What it means

Error "palace at {palace_path!r} contains {detected!r} backend artifacts, but {selected!r} was selected" thrown in MemPalace/mempalace.

Source

Thrown at mempalace/palace.py:406

    """
    explicit = explicit or os.environ.get(_EXPLICIT_BACKEND_ENV)
    selected = resolve_backend_for_palace(
        explicit=explicit.strip().lower() if explicit else None,
        config_value=_config_backend_value(palace_path),
        env_value=_env_backend_value(),
        palace_path=palace_path,
        default="chroma",
    )
    get_backend_class(selected)
    detected_backends = detect_backends_for_path(palace_path)
    if len(detected_backends) > 1:
        raise BackendMismatchError(
            f"palace at {palace_path!r} contains multiple backend artifacts: "
            f"{', '.join(detected_backends)}"
        )
    detected = detected_backends[0] if detected_backends else None
    if detected and detected != selected:
        raise BackendMismatchError(
            f"palace at {palace_path!r} contains {detected!r} backend artifacts, "
            f"but {selected!r} was selected"
        )
    return selected


_MULTI_PROCESS_WRITER_BACKENDS = frozenset({"pgvector", "qdrant"})


def backend_requires_single_writer(backend_name: str) -> bool:
    """Return whether a backend needs one process-lifetime writer owner.

    Local file-backed backends cannot safely coordinate independent long-lived
    clients by serializing only individual calls: each process may retain
    SQLite/WAL, FTS, or vector-index state across operations. Unknown and
    plugin backends are treated conservatively. Only backends whose storage
    service is explicitly responsible for cross-process concurrency opt out.
    """

View on GitHub (pinned to 06cb6987f0)

Solutions

  1. Select the backend that matches the on-disk artifacts, or migrate the palace to the desired backend

When it happens

Trigger: Thrown at mempalace/palace.py:406 when the library encounters an invalid state.

Common situations: Selected backend does not match the artifacts present in the palace directory.


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