{"record":{"id":"ccf6fa8d39a7fedb","repo":"BerriAI/litellm","slug":"ephemeral-proxy-never-became-healthy-within-timeo","errorCode":null,"errorMessage":"Ephemeral proxy never became healthy within {timeout}s. Last log lines:\n{_tail(log_path)}","messagePattern":"Ephemeral proxy never became healthy within (.+?)s\\. Last log lines:\n(.+?)","errorType":"exception","errorClass":"ProcessLaunchError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/client/cli/commands/autoroute/process.py","lineNumber":108,"sourceCode":"    if not log_path.exists():\n        return \"(no log output captured)\"\n    return \"\\n\".join(log_path.read_text(errors=\"replace\").splitlines()[-lines:])\n\n\ndef poll_liveliness(base_url: str, log_path: Path, process: \"subprocess.Popen[bytes]\", timeout: float = 30.0) -> None:\n    \"\"\"Poll /health/liveliness until it responds, the process dies, or timeout elapses.\"\"\"\n    deadline: Final = time.monotonic() + timeout\n    url: Final = base_url.rstrip(\"/\") + \"/health/liveliness\"\n    while time.monotonic() < deadline:\n        if process.poll() is not None:\n            raise ProcessLaunchError(\n                f\"Ephemeral proxy exited early (code {process.returncode}). Last log lines:\\n{_tail(log_path)}\"\n            )\n        with contextlib.suppress(requests.RequestException):\n            if requests.get(url, timeout=2).status_code == 200:\n                return\n        time.sleep(0.5)\n    raise ProcessLaunchError(\n        f\"Ephemeral proxy never became healthy within {timeout}s. Last log lines:\\n{_tail(log_path)}\"\n    )\n\n\ndef write_pid_record(record: PidRecord, path: Path | None = None) -> None:\n    resolved_path: Final = path if path is not None else PID_RECORD_PATH\n    resolved_path.parent.mkdir(parents=True, exist_ok=True)\n    with open(resolved_path, \"w\") as f:\n        json.dump(\n            {\"pid\": record.pid, \"port\": record.port, \"config_path\": record.config_path, \"log_path\": record.log_path},\n            f,\n            indent=2,\n        )\n\n\ndef read_pid_record(path: Path | None = None) -> PidRecord | None:\n    resolved_path: Final = path if path is not None else PID_RECORD_PATH\n    if not resolved_path.exists():","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/client/cli/commands/autoroute/process.py#L90-L126","documentation":"Raised by poll_liveliness when the ephemeral proxy subprocess started for autoroute never answered /health/liveliness within the timeout window (the process dying earlier has its own error). The message embeds the timeout and the tail of the captured proxy log so the operator can see why the proxy failed to become healthy — usually a bad config or port conflict.","triggerScenarios":"Thrown at litellm/proxy/client/cli/commands/autoroute/process.py:108 when the library encounters an invalid state.","commonSituations":"The ephemeral proxy did not pass its health check within the timeout.","solutions":["Inspect the last log lines for startup errors.","Increase the timeout or fix the blocking startup issue (port in use, bad config)."],"exampleFix":"Check the log file path in the error and resolve the reported startup failure.","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}