{"record":{"id":"ce1c75357a085980","repo":"langchain-ai/deepagents","slug":"server-graph-graph-name-did-not-initialize-wit","errorCode":null,"errorMessage":"Server graph '{graph_name}' did not initialize within {timeout}s","messagePattern":"Server graph '(.+?)' did not initialize within (.+?)s","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/client/launch/server.py","lineNumber":1044,"sourceCode":"                    resp = await client.get(graph_url, timeout=remaining)\n                except (httpx.TransportError, httpx.TimeoutException, OSError) as exc:\n                    output = self._read_log_file()\n                    summary = _extract_startup_error_marker(output)\n                    if self._process.poll() is not None:\n                        msg = (\n                            f\"Server process exited with code \"\n                            f\"{self._process.returncode}\"\n                        )\n                    else:\n                        msg = (\n                            f\"Server graph '{graph_name}' did not initialize within \"\n                            f\"{timeout}s\"\n                        )\n                    if summary:\n                        msg += f\": {summary}\"\n                    if output:\n                        msg += f\"\\n{output[-_LOG_TAIL_CHARS:]}\"\n                    raise RuntimeError(msg) from exc\n\n                if resp.status_code == 200:  # noqa: PLR2004\n                    logger.info(\"Server graph %s is ready at %s\", graph_name, self.url)\n                    return\n\n                output = self._read_log_file()\n                msg = (\n                    f\"Server graph '{graph_name}' failed readiness check \"\n                    f\"(status: {resp.status_code})\"\n                )\n                summary = _extract_startup_error_marker(output)\n                if summary:\n                    msg += f\": {summary}\"\n                if output:\n                    msg += f\"\\n{output[-_LOG_TAIL_CHARS:]}\"\n                raise RuntimeError(msg)\n\n        msg = f\"Server graph '{graph_name}' did not initialize within {timeout}s\"","sourceCodeStart":1026,"sourceCodeEnd":1062,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/client/launch/server.py#L1026-L1062","documentation":"Raised from the transport-error branch of `wait_for_graph_ready`: the readiness GET to `/assistants/{graph_name}/graph` failed with httpx.TransportError/TimeoutException/OSError, and while handling it the code found the process still alive, so the graph simply never initialized within `timeout`. The message includes any startup error marker extracted from the server log plus the log tail.","triggerScenarios":"Server is running but never serves the graph endpoint within the timeout — slow first install of runtime dependencies (`uv sync` on cold start), server listening on a different port than `self.url`, connection refused due to a bind mismatch, or an extremely low `timeout` argument passed to wait_for_graph_ready/start.","commonSituations":"First launch on a slow machine or network where dependency installation exceeds the default health timeout; firewall/antivirus delaying socket binds; custom ports misconfigured so the client polls the wrong URL.","solutions":["Inspect the appended server log tail for a startup error marker; fix that error if present","Increase the timeout: pass a larger `timeout` to start/wait_for_graph_ready (cold dependency installs can exceed the default)","Verify the server bound to the expected host/port matching `self.url`","Retry the launch once — transient slowness (uv cache cold) often resolves on second start"],"exampleFix":"// before\nawait manager.start_server_and_get_agent(...)  # 30s default, cold uv sync times out\n// after\nawait manager.start_server_and_get_agent(..., timeout=120.0)  # allow cold install","handlingStrategy":"retry","validationCode":"# ensure the expected port is reachable before starting\nimport socket\ns = socket.socket(); s.settimeout(1)\ntry:\n    s.connect((host, port))\nfinally:\n    s.close()","typeGuard":null,"tryCatchPattern":"try:\n    await server.wait_for_graph_ready(timeout=120.0)\nexcept RuntimeError as e:\n    if \"did not initialize\" in e.args[0]:\n        # inspect log tail in message, then retry once\n        ...","preventionTips":["Use a generous timeout on cold starts (first run installs deps via uv)","Confirm the server binds to the host/port the client URL expects","Pre-warm the runtime venv so cold installs do not eat the budget","Check firewall/AV if binds are delayed"],"tags":["timeout","network","startup"],"backgroundTag":"server-startup-timeout","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}