MemPalace/mempalace · error · ValueError
Target room '{target_room}' does not exist in wing '{target_
Error message
Target room '{target_room}' does not exist in wing '{target_wing}' What it means
Error "Target room '{target_room}' does not exist in wing '{target_wing}'" thrown in MemPalace/mempalace.
Source
Thrown at mempalace/palace_graph.py:561
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
# Serialize the load → mutate → save cycle. Without this, two concurrent
# create_tunnel calls can both read the same snapshot and the laterView on GitHub (pinned to 06cb6987f0)
Solutions
- Create the target room first, or check the wing/room names for typos
When it happens
Trigger: Thrown at mempalace/palace_graph.py:561 when the library encounters an invalid state.
Common situations: Tunnel creation referenced a target room that does not exist.
AI-assisted analysis of MemPalace/mempalace@06cb6987f0 (2026-08-15).
Data as JSON: /api/errors/9f315e84dc93d3a1.
Report an issue: GitHub.