{"record":{"id":"abd841187db9adb6","repo":"langchain-ai/langgraph","slug":"protocol-error-code-message-abd841","errorCode":null,"errorMessage":"Protocol error [{code}]: {message}","messagePattern":"Protocol error \\[(.+?)\\]: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"libs/sdk-py/langgraph_sdk/_sync/stream.py","lineNumber":1482,"sourceCode":"        finally:\n            self._unregister_subscription(sub.id)\n\n    def _send_command(self, method: str, params: dict[str, Any]) -> dict[str, Any]:\n        \"\"\"Send a protocol command and return the `result` payload.\"\"\"\n        if self._transport is None:\n            raise RuntimeError(\"SyncThreadStream not entered — use `with`.\")\n        with self._command_id_lock:\n            command_id = self._next_command_id\n            self._next_command_id += 1\n        response = self._transport.send_command(\n            {\"id\": command_id, \"method\": method, \"params\": params}\n        )\n        if response is None:\n            return {}\n        if response.get(\"type\") == \"error\":\n            code = response.get(\"error\", \"unknown\")\n            message = response.get(\"message\", \"\")\n            raise RuntimeError(f\"Protocol error [{code}]: {message}\")\n        meta = response.get(\"meta\")\n        if isinstance(meta, dict):\n            applied_through_seq = meta.get(\"applied_through_seq\")\n            if self._controller is not None:\n                self._controller.observe_applied_through_seq(applied_through_seq)\n        return response.get(\"result\", {})\n\n    def _ensure_lifecycle_watcher_running(self) -> None:\n        if self._lifecycle_watcher_thread is not None:\n            return\n        self._lifecycle_watcher_thread = threading.Thread(\n            target=self._run_lifecycle_watcher,\n            name=\"langgraph-sdk-sync-lifecycle\",\n            daemon=True,\n        )\n        self._lifecycle_watcher_thread.start()\n\n    def _observe_lifecycle_event(self, event: Event) -> None:","sourceCodeStart":1464,"sourceCodeEnd":1500,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/sdk-py/langgraph_sdk/_sync/stream.py#L1464-L1500","documentation":"Error \"Protocol error [{code}]: {message}\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/sdk-py/langgraph_sdk/_sync/stream.py:1482 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}