{"record":{"id":"d5ac7522d6a974a2","repo":"rohitg00/ai-engineering-from-scratch","slug":"no-entry-node-set","errorCode":null,"errorMessage":"no entry node set","messagePattern":"no entry node set","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"phases/14-agent-engineering/13-langgraph-stateful-graphs/code/main.py","lineNumber":106,"sourceCode":"        self.state = state\n\n\nclass Runner:\n    def __init__(self, graph: StateGraph,\n                 checkpointer: InMemoryCheckpointer) -> None:\n        self.graph = graph\n        self.checkpointer = checkpointer\n\n    def run(self, session_id: str, initial_state: State,\n            resume_from: str | None = None,\n            state_override: State | None = None) -> State:\n        if state_override is not None:\n            state = copy.deepcopy(state_override)\n        else:\n            state = copy.deepcopy(initial_state)\n        current = resume_from or self.graph.entry\n        if current is None:\n            raise RuntimeError(\"no entry node set\")\n        while current is not None and current != END:\n            fn = self.graph.nodes.get(current)\n            if fn is None:\n                raise RuntimeError(f\"unknown node {current!r}\")\n            update = fn(state)\n            if update is None:\n                update = {}\n            state = {**state, **update}\n            self.checkpointer.save(session_id, current, state)\n            if state.get(\"_pause_reason\"):\n                reason = state.pop(\"_pause_reason\")\n                raise PausedAtNode(current, state)\n            current = self.graph._next(current, state)\n        return state\n\n\ndef _classify(state: State) -> Update:\n    text = state[\"input\"].lower()","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/rohitg00/ai-engineering-from-scratch/blob/39ea8a1c6d0b61f071226eff7ede4d4105fed820/phases/14-agent-engineering/13-langgraph-stateful-graphs/code/main.py#L88-L124","documentation":"Runner.run starts execution at graph.entry (or a resume_from node). This RuntimeError fires when the StateGraph was never given an entry node, so there is no starting point for the traversal even though state was deep-copied and a checkpointer exists.","triggerScenarios":"Thrown at phases/14-agent-engineering/13-langgraph-stateful-graphs/code/main.py:106 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call set_entry (or the graph builder's entry API) with a registered node name before running","Verify the entry node was added after a graph rebuild that cleared nodes","Assert graph.entry is not None in graph construction tests","Pass resume_from when you intend to start mid-graph instead of relying on an entry"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"39ea8a1c6d0b61f071226eff7ede4d4105fed820","analyzedAt":"2026-08-26T03:13:46.626Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}