MemPalace/mempalace · error · PalaceNotFoundError

{marker_path}

Error message

{marker_path}

What it means

Raised when opening a collection with create=False: the palace has a local path but the qdrant marker file does not exist there. The marker is the backend's proof that this palace was ever initialized with the qdrant backend; without it, open-for-read must fail rather than fabricate an empty collection view.

Source

Thrown at mempalace/backends/qdrant.py:1347

        *args,
        **kwargs,
    ) -> QdrantCollection:
        palace, collection_name, create, options = self._normalize_args(args, kwargs)
        config = _QdrantConfig.from_options(options)
        if palace.namespace and palace.namespace != config.namespace:
            config = _QdrantConfig(
                url=config.url,
                api_key=config.api_key,
                timeout=config.timeout,
                namespace=palace.namespace,
            )
        client = self._client(config)
        if palace.local_path:
            marker_path = self._marker_path(palace.local_path)
            if os.path.isfile(marker_path):
                self._validate_marker_target(palace, config)
            elif not create:
                raise PalaceNotFoundError(marker_path)
        else:
            # The qdrant marker is this backend's only mismatch-protection
            # anchor, and it lives next to the palace on local disk. With no
            # local_path (the pure-remote / hosted mode) we can neither write
            # nor validate it, so opening would silently drop protection
            # against URL/namespace drift. Refuse loudly instead. A remote
            # marker store for pure-remote palaces is tracked as a follow-up.
            raise BackendError(
                "qdrant backend requires a local palace path to anchor mismatch "
                "protection; pure-remote palaces (local_path=None) are not "
                "supported yet"
            )
        remote_collection = self._remote_collection_name(
            palace=palace,
            collection_name=collection_name,
            config=config,
        )
        if not create and not client.collection_exists(remote_collection):

View on GitHub (pinned to 06cb6987f0)

Solutions

  1. Open with create=True the first time you touch a palace with the qdrant backend
  2. Verify you are pointing at the intended palace directory (typo'd/relative path)
  3. If the palace was created with a different backend, open it with that backend instead

Example fix

// before
col = backend.get_collection(palace, "drawers")  # no marker -> PalaceNotFoundError
// after
col = backend.get_collection(palace, "drawers", create=True)  # writes marker + creates remote
Defensive patterns

Strategy: validation

Validate before calling

import os
def open_or_create(backend, palace, name):
    marker = os.path.join(palace.local_path, "qdrant-marker.json")
    return backend.get_collection(palace, name, create=not os.path.isfile(marker))

Try / catch

from mempalace.backends.base import PalaceNotFoundError
try:
    col = backend.get_collection(palace, name)
except PalaceNotFoundError:
    col = backend.get_collection(palace, name, create=True)

Prevention

When it happens

Trigger: get_collection(palace_ref_with_local_path, name, create=False) when <palace>/qdrant-marker.json is absent — e.g. a brand-new palace directory, a palace created by another backend, or a marker that was deleted.

Common situations: First use of a new palace directory without create=True; switching backends on an existing directory; marker removed by cleanup scripts or 'clean rebuild' attempts that expected the backend to recreate state.

Related errors


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