MemPalace/mempalace · error · PalaceNotFoundError

ChromaBackend requires PalaceRef.local_path

Error message

ChromaBackend requires PalaceRef.local_path

What it means

A KeyError (with a descriptive message) from get_adapter_class: the named source adapter is not in the registry. Registry population includes entry-point discovery, so an unknown name means the adapter is neither built-in nor provided by an installed plugin exposing the right entry points.

Source

Thrown at mempalace/backends/chroma.py:2437

        self,
        *args,
        **kwargs,
    ) -> ChromaCollection:
        """Obtain a collection for a palace.

        Supports two calling conventions during the RFC 001 transition:

        * New (preferred): ``get_collection(palace=PalaceRef, collection_name=...,
          create=False, options=None)``.
        * Legacy: ``get_collection(palace_path, collection_name, create=False)``
          — still used by callers not yet migrated.
        """
        palace_ref, collection_name, create, options = _normalize_get_collection_args(args, kwargs)
        self.require_namespace_support(palace_ref)

        palace_path = palace_ref.local_path
        if palace_path is None:
            raise PalaceNotFoundError("ChromaBackend requires PalaceRef.local_path")

        if not create and not os.path.isdir(palace_path):
            raise PalaceNotFoundError(palace_path)

        if create:
            os.makedirs(palace_path, exist_ok=True)
            try:
                os.chmod(palace_path, 0o700)
            except (OSError, NotImplementedError):
                pass

        client = self._client(palace_path)

        ef = self._resolve_embedding_function()
        ef_kwargs = {"embedding_function": ef} if ef is not None else {}

        if create:
            try:

View on GitHub (pinned to 06cb6987f0)

Solutions

  1. Call available_adapters() and use one of the names it returns (the error message lists them).
  2. Install/reinstall the plugin package that provides the adapter so its entry points register.
  3. Check the spelling/case of the adapter name against the plugin's documentation.

Example fix

from mempalace.sources.registry import available_adapters, get_adapter_class
name = 'git' if 'git' in available_adapters() else available_adapters()[0]
cls = get_adapter_class(name)
Defensive patterns

Strategy: validation

Validate before calling

from mempalace.sources.registry import available_adapters
if name not in available_adapters():
    raise SystemExit(f'unknown adapter {name!r}; install its plugin package')

Type guard

def adapter_exists(name: str) -> bool:
    from mempalace.sources.registry import available_adapters
    return name in available_adapters()

Try / catch

try:
    cls = get_adapter_class(name)
except KeyError as e:
    msg = str(e)
    # message enumerates available adapters; surface it to config authors

Prevention

When it happens

Trigger: Calling get_adapter_class(name) with a misspelled adapter name, or a name provided by a plugin whose package is not installed or whose entry points were not discovered.

Common situations: Typos in source config; forgetting to pip-install the extra providing the adapter; plugin package present but its entry-point metadata broken; stale environment after adding a plugin without reinstalling.

Related errors


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