{"record":{"id":"3182fa7b104a36e6","repo":"MemPalace/mempalace","slug":"palace-at-palace-path-r-contains-detected-r-ba","errorCode":null,"errorMessage":"palace at {palace_path!r} contains {detected!r} backend artifacts, but {selected!r} was selected","messagePattern":"palace at (.+?) contains (.+?) backend artifacts, but (.+?) was selected","errorType":"exception","errorClass":"BackendMismatchError","httpStatus":null,"severity":"error","filePath":"mempalace/palace.py","lineNumber":406,"sourceCode":"    \"\"\"\n    explicit = explicit or os.environ.get(_EXPLICIT_BACKEND_ENV)\n    selected = resolve_backend_for_palace(\n        explicit=explicit.strip().lower() if explicit else None,\n        config_value=_config_backend_value(palace_path),\n        env_value=_env_backend_value(),\n        palace_path=palace_path,\n        default=\"chroma\",\n    )\n    get_backend_class(selected)\n    detected_backends = detect_backends_for_path(palace_path)\n    if len(detected_backends) > 1:\n        raise BackendMismatchError(\n            f\"palace at {palace_path!r} contains multiple backend artifacts: \"\n            f\"{', '.join(detected_backends)}\"\n        )\n    detected = detected_backends[0] if detected_backends else None\n    if detected and detected != selected:\n        raise BackendMismatchError(\n            f\"palace at {palace_path!r} contains {detected!r} backend artifacts, \"\n            f\"but {selected!r} was selected\"\n        )\n    return selected\n\n\n_MULTI_PROCESS_WRITER_BACKENDS = frozenset({\"pgvector\", \"qdrant\"})\n\n\ndef backend_requires_single_writer(backend_name: str) -> bool:\n    \"\"\"Return whether a backend needs one process-lifetime writer owner.\n\n    Local file-backed backends cannot safely coordinate independent long-lived\n    clients by serializing only individual calls: each process may retain\n    SQLite/WAL, FTS, or vector-index state across operations. Unknown and\n    plugin backends are treated conservatively. Only backends whose storage\n    service is explicitly responsible for cross-process concurrency opt out.\n    \"\"\"","sourceCodeStart":388,"sourceCodeEnd":424,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/palace.py#L388-L424","documentation":"Error \"palace at {palace_path!r} contains {detected!r} backend artifacts, but {selected!r} was selected\" thrown in MemPalace/mempalace.","triggerScenarios":"Thrown at mempalace/palace.py:406 when the library encounters an invalid state.","commonSituations":"Selected backend does not match the artifacts present in the palace directory.","solutions":["Select the backend that matches the on-disk artifacts, or migrate the palace to the desired backend"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06cb6987f02610784fefbad4b2bd5d026d164ba6","analyzedAt":"2026-08-15T03:03:36.213Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}