{"record":{"id":"fd04288c83683e3c","repo":"BerriAI/litellm","slug":"opensandbox-sandbox-sandbox-id-was-not-running-w","errorCode":null,"errorMessage":"OpenSandbox sandbox {sandbox_id} was not Running within {ready_timeout} seconds","messagePattern":"OpenSandbox sandbox (.+?) was not Running within (.+?) seconds","errorType":"exception","errorClass":"TimeoutError","httpStatus":null,"severity":"error","filePath":"litellm/llms/opensandbox/sandbox/transformation.py","lineNumber":262,"sourceCode":"        poll_interval: float,\n    ) -> None:\n        deadline: Final = time.monotonic() + ready_timeout\n        while True:\n            response = cast(\n                httpx.Response,\n                await self._http(client).get(\n                    url=f\"{api_base}/sandboxes/{sandbox_id}\",\n                    headers=headers,\n                ),\n            )\n            data = response.json()\n            state = self._sandbox_state(data)\n            if state == \"Running\":\n                return\n            if state in {\"Failed\", \"Stopping\", \"Terminated\"}:\n                raise ValueError(f\"OpenSandbox sandbox {sandbox_id} entered {state}\")\n            if time.monotonic() >= deadline:\n                raise TimeoutError(f\"OpenSandbox sandbox {sandbox_id} was not Running within {ready_timeout} seconds\")\n            await asyncio.sleep(poll_interval)\n\n    async def _wait_for_execd_endpoint(\n        self,\n        *,\n        sandbox_id: str,\n        api_base: str,\n        headers: dict[str, str],\n        use_server_proxy: bool,\n        client: AsyncHTTPHandler | None,\n        ready_timeout: float,\n        poll_interval: float,\n    ) -> tuple[str, dict[str, str]]:\n        deadline: Final = time.monotonic() + ready_timeout\n        last_error: Exception | None = None\n        while True:\n            try:\n                return await self._get_execd_endpoint(","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/opensandbox/sandbox/transformation.py#L244-L280","documentation":"The OpenSandbox boot wait loop polls the sandbox state until it equals Running. When the monotonic deadline (ready_timeout seconds, checked with time.monotonic()) passes while the sandbox is still in a non-terminal state like Pending or Creating, TimeoutError is raised with the configured timeout value.","triggerScenarios":"Sandbox provisioning takes longer than ready_timeout: cold-start image pulls, provider capacity pressure, very large images or resource requests, or ready_timeout left at a small default.","commonSituations":"Peak-hour provisioning delays; first-boot of a heavy custom image; network latency between litellm and the sandbox control plane; timeouts set for fast images then reused for slow ones.","solutions":["Increase ready_timeout in the OpenSandbox call/config","Retry sandbox creation - sandboxes stuck in Pending often succeed on a second attempt","Use a smaller or pre-warmed image to cut boot time","Check the provider status page for provisioning delays"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"Catch TimeoutError separately from ValueError: log elapsed provisioning time, then retry create-with-wait once or twice with a larger ready_timeout before surfacing the failure - Pending/Creating states are usually transient, unlike terminal states.","preventionTips":["Set ready_timeout generously for first-boot or large images","Alert on repeated provisioning timeouts to detect capacity problems early","Prefer pre-warmed images in latency-sensitive paths"],"tags":["opensandbox","sandbox","timeout","provisioning","litellm"],"backgroundTag":"operation-timeout","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}