{"record":{"id":"e58e71a8e9fe0c37","repo":"langchain-ai/deepagents","slug":"server-process-is-not-running","errorCode":null,"errorMessage":"Server process is not running","messagePattern":"Server process is not running","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/client/launch/server.py","lineNumber":1007,"sourceCode":"        graph_name: str = \"agent\",\n        *,\n        timeout: float = _HEALTH_TIMEOUT,  # noqa: ASYNC109\n    ) -> None:\n        \"\"\"Resolve the served graph once so lazy startup failures surface early.\n\n        Args:\n            graph_name: Registered graph name from `langgraph.json`.\n            timeout: Max seconds to wait for the graph readiness request.\n\n        Raises:\n            RuntimeError: If the server process exits or the graph endpoint\n                does not return a successful response.\n        \"\"\"\n        import httpx\n\n        if self._process is None:\n            msg = \"Server process is not running\"\n            raise RuntimeError(msg)\n\n        graph_url = f\"{self.url}/assistants/{quote(graph_name, safe='')}/graph\"\n        deadline = time.monotonic() + timeout\n\n        async with httpx.AsyncClient() as client:\n            while time.monotonic() < deadline:\n                if self._process.poll() is not None:\n                    msg = f\"Server process exited with code {self._process.returncode}\"\n                    output = self._read_log_file()\n                    if output:\n                        summary = _extract_startup_error_marker(output)\n                        if summary:\n                            msg += f\": {summary}\"\n                        msg += f\"\\n{output[-_LOG_TAIL_CHARS:]}\"\n                    raise RuntimeError(msg)\n\n                remaining = max(0.1, deadline - time.monotonic())\n                try:","sourceCodeStart":989,"sourceCodeEnd":1025,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/client/launch/server.py#L989-L1025","documentation":"`wait_for_graph_ready` polls the LangGraph dev server's `/assistants/{graph_name}/graph` endpoint until the graph resolves. Before polling it checks that a server subprocess handle exists; if `self._process` is None it raises this RuntimeError because there is nothing to wait for. It means readiness was requested without a server ever having been started (or after it was stopped).","triggerScenarios":"Calling `wait_for_graph_ready` on a ServerProcess before `start_server_and_get_agent`/startup has spawned the subprocess, after `stop()`/`_stop_process()` cleared `self._process`, or after a respawn path failed to launch a new process. Callers affected: `_respawn_server`, `start_server_and_get_agent`.","commonSituations":"Manually invoking stop() then retrying readiness without restarting; a race where the server exited and its handle was cleared before readiness polling; custom scripts that construct a ServerProcess and call wait_for_graph_ready directly.","solutions":["Start the server first (call the launch/start API) before awaiting wait_for_graph_ready","If the server was stopped intentionally, restart it via restart() or _respawn_server before checking readiness","Check whether an earlier startup failure already stopped the server and handle that error instead of retrying readiness","Ensure no code path calls stop() concurrently with wait_for_graph_ready (state is guarded by _state_lock)"],"exampleFix":"// before\nserver = ServerProcess(...)\nawait server.wait_for_graph_ready()  # RuntimeError: process is None\n// after\nserver = ServerProcess(...)\nawait server.start()\nawait server.wait_for_graph_ready()","handlingStrategy":"validation","validationCode":"if server._process is None:\n    server = await server.start()  # or restart() before polling\nawait server.wait_for_graph_ready()","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always start the server through the library's launch API before awaiting readiness","Never call stop() and wait_for_graph_ready() concurrently","Treat a stopped server as terminal: restart, do not re-poll"],"tags":["lifecycle","subprocess","runtime-error"],"backgroundTag":"server-not-started","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}