MemPalace/mempalace · error · ValueError

no palace path configured; run mempalace init first

Error message

no palace path configured; run mempalace init first

What it means

Error "no palace path configured; run mempalace init first" thrown in MemPalace/mempalace.

Source

Thrown at mempalace/mcp_server.py:1117

            return op(kg)
        except sqlite3.ProgrammingError:
            if attempt == 0:
                with _kg_cache_lock:
                    if _kg_by_path.get(path) is kg:
                        _kg_by_path.pop(path, None)
                continue
            raise


def _resolve_logstream_path() -> str:
    """Resolve the RFC 003 logstream database path in the active palace.

    Fails clearly (ValueError) when no palace path is configured — the
    logstream must never silently write outside the palace directory.
    """
    palace_path = getattr(_config, "palace_path", None) or MempalaceConfig().palace_path
    if not palace_path:
        raise ValueError("no palace path configured; run mempalace init first")
    return os.path.join(os.path.expanduser(palace_path), LOGSTREAM_DB_FILENAME)


def _get_logstream(canonical_path=None) -> Logstream:
    """Return the cached ``Logstream`` for the resolved palace.

    Same canonical-key contract as :func:`_get_kg`: callers inside a retry
    loop pass the captured key through so insert and evict keys cannot
    drift apart under palace-path rotation.
    """
    path = (
        canonical_path
        if canonical_path is not None
        else _canonicalize_kg_path(_resolve_logstream_path())
    )
    ls = _logstream_by_path.get(path)
    if ls is not None:
        return ls

View on GitHub (pinned to 06cb6987f0)

Solutions

  1. Run `mempalace init` to create and configure a palace path

When it happens

Trigger: Thrown at mempalace/mcp_server.py:1117 when the library encounters an invalid state.

Common situations: MCP server started without an initialized palace configuration.


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