MemPalace/mempalace · error · ValueError

Source room '{source_room}' does not exist in wing '{source_

Error message

Source room '{source_room}' does not exist in wing '{source_wing}'

What it means

Error "Source room '{source_room}' does not exist in wing '{source_wing}'" thrown in MemPalace/mempalace.

Source

Thrown at mempalace/palace_graph.py:559

    """
    source_wing = _require_name(source_wing, "source_wing")
    source_room = _require_name(source_room, "source_room")
    target_wing = _require_name(target_wing, "target_wing")
    target_room = _require_name(target_room, "target_room")

    # Single MempalaceConfig() per call — reused by _get_tunnel_file /
    # _load_tunnels / _save_tunnels below. Each MempalaceConfig() re-reads
    # mempalace.yaml from disk; before this change the helpers each
    # instantiated their own, triggering several redundant disk reads per
    # create_tunnel call (flagged by gemini-code-assist on #1469).
    config = config or MempalaceConfig()

    # Validate room existence for explicit tunnels only. Use the verbatim wing
    # slugs here so #1504's hyphen-preserving write path remains intact.
    if kind == "explicit":
        col = _get_collection(config)
        if not _check_room_exists(source_wing, source_room, col):
            raise ValueError(f"Source room '{source_room}' does not exist in wing '{source_wing}'")
        if not _check_room_exists(target_wing, target_room, col):
            raise ValueError(f"Target room '{target_room}' does not exist in wing '{target_wing}'")

    tunnel_id = _canonical_tunnel_id(source_wing, source_room, target_wing, target_room)

    tunnel = {
        "id": tunnel_id,
        "source": {"wing": source_wing, "room": source_room},
        "target": {"wing": target_wing, "room": target_room},
        "label": label,
        "kind": kind,
        "created_at": datetime.now(timezone.utc).isoformat(),
    }
    if source_drawer_id:
        tunnel["source"]["drawer_id"] = source_drawer_id
    if target_drawer_id:
        tunnel["target"]["drawer_id"] = target_drawer_id

View on GitHub (pinned to 06cb6987f0)

Solutions

  1. Create the source room first, or check the wing/room names for typos

When it happens

Trigger: Thrown at mempalace/palace_graph.py:559 when the library encounters an invalid state.

Common situations: Tunnel creation referenced a source room that does not exist.


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