{"record":{"id":"6c07e542748bb5e5","repo":"MemPalace/mempalace","slug":"no-palace-path-configured-run-mempalace-init-firs","errorCode":null,"errorMessage":"no palace path configured; run mempalace init first","messagePattern":"no palace path configured; run mempalace init first","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"mempalace/mcp_server.py","lineNumber":1117,"sourceCode":"            return op(kg)\n        except sqlite3.ProgrammingError:\n            if attempt == 0:\n                with _kg_cache_lock:\n                    if _kg_by_path.get(path) is kg:\n                        _kg_by_path.pop(path, None)\n                continue\n            raise\n\n\ndef _resolve_logstream_path() -> str:\n    \"\"\"Resolve the RFC 003 logstream database path in the active palace.\n\n    Fails clearly (ValueError) when no palace path is configured — the\n    logstream must never silently write outside the palace directory.\n    \"\"\"\n    palace_path = getattr(_config, \"palace_path\", None) or MempalaceConfig().palace_path\n    if not palace_path:\n        raise ValueError(\"no palace path configured; run mempalace init first\")\n    return os.path.join(os.path.expanduser(palace_path), LOGSTREAM_DB_FILENAME)\n\n\ndef _get_logstream(canonical_path=None) -> Logstream:\n    \"\"\"Return the cached ``Logstream`` for the resolved palace.\n\n    Same canonical-key contract as :func:`_get_kg`: callers inside a retry\n    loop pass the captured key through so insert and evict keys cannot\n    drift apart under palace-path rotation.\n    \"\"\"\n    path = (\n        canonical_path\n        if canonical_path is not None\n        else _canonicalize_kg_path(_resolve_logstream_path())\n    )\n    ls = _logstream_by_path.get(path)\n    if ls is not None:\n        return ls","sourceCodeStart":1099,"sourceCodeEnd":1135,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/mcp_server.py#L1099-L1135","documentation":"Error \"no palace path configured; run mempalace init first\" thrown in MemPalace/mempalace.","triggerScenarios":"Thrown at mempalace/mcp_server.py:1117 when the library encounters an invalid state.","commonSituations":"MCP server started without an initialized palace configuration.","solutions":["Run `mempalace init` to create and configure a palace path"],"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-15T22:17:37.221Z"}