{"record":{"id":"ca2a9bffcbba2bc7","repo":"MemPalace/mempalace","slug":"chromabackend-requires-palaceref-local-path","errorCode":null,"errorMessage":"ChromaBackend requires PalaceRef.local_path","messagePattern":"ChromaBackend requires PalaceRef\\.local_path","errorType":"exception","errorClass":"PalaceNotFoundError","httpStatus":null,"severity":"error","filePath":"mempalace/backends/chroma.py","lineNumber":2437,"sourceCode":"        self,\n        *args,\n        **kwargs,\n    ) -> ChromaCollection:\n        \"\"\"Obtain a collection for a palace.\n\n        Supports two calling conventions during the RFC 001 transition:\n\n        * New (preferred): ``get_collection(palace=PalaceRef, collection_name=...,\n          create=False, options=None)``.\n        * Legacy: ``get_collection(palace_path, collection_name, create=False)``\n          — still used by callers not yet migrated.\n        \"\"\"\n        palace_ref, collection_name, create, options = _normalize_get_collection_args(args, kwargs)\n        self.require_namespace_support(palace_ref)\n\n        palace_path = palace_ref.local_path\n        if palace_path is None:\n            raise PalaceNotFoundError(\"ChromaBackend requires PalaceRef.local_path\")\n\n        if not create and not os.path.isdir(palace_path):\n            raise PalaceNotFoundError(palace_path)\n\n        if create:\n            os.makedirs(palace_path, exist_ok=True)\n            try:\n                os.chmod(palace_path, 0o700)\n            except (OSError, NotImplementedError):\n                pass\n\n        client = self._client(palace_path)\n\n        ef = self._resolve_embedding_function()\n        ef_kwargs = {\"embedding_function\": ef} if ef is not None else {}\n\n        if create:\n            try:","sourceCodeStart":2419,"sourceCodeEnd":2455,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/backends/chroma.py#L2419-L2455","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Call available_adapters() and use one of the names it returns (the error message lists them).","Install/reinstall the plugin package that provides the adapter so its entry points register.","Check the spelling/case of the adapter name against the plugin's documentation."],"exampleFix":"from mempalace.sources.registry import available_adapters, get_adapter_class\nname = 'git' if 'git' in available_adapters() else available_adapters()[0]\ncls = get_adapter_class(name)","handlingStrategy":"validation","validationCode":"from mempalace.sources.registry import available_adapters\nif name not in available_adapters():\n    raise SystemExit(f'unknown adapter {name!r}; install its plugin package')","typeGuard":"def adapter_exists(name: str) -> bool:\n    from mempalace.sources.registry import available_adapters\n    return name in available_adapters()","tryCatchPattern":"try:\n    cls = get_adapter_class(name)\nexcept KeyError as e:\n    msg = str(e)\n    # message enumerates available adapters; surface it to config authors","preventionTips":["Validate adapter names against available_adapters() at config load time.","Declare plugin dependencies explicitly so adapter-providing packages are always installed."],"tags":["plugins","registry","entry-points","validation"],"backgroundTag":null,"analyzedSha":"06cb6987f02610784fefbad4b2bd5d026d164ba6","analyzedAt":"2026-08-15T03:03:36.213Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}