{"record":{"id":"fbb2f182f27192be","repo":"BerriAI/litellm","slug":"opensandbox-execd-endpoint-for-sandbox-id-was-no","errorCode":null,"errorMessage":"OpenSandbox execd endpoint for {sandbox_id} was not ready within {ready_timeout} seconds","messagePattern":"OpenSandbox execd endpoint for (.+?) was not ready within (.+?) seconds","errorType":"exception","errorClass":"TimeoutError","httpStatus":null,"severity":"error","filePath":"litellm/llms/opensandbox/sandbox/transformation.py","lineNumber":295,"sourceCode":"        last_error: Exception | None = None\n        while True:\n            try:\n                return await self._get_execd_endpoint(\n                    sandbox_id=sandbox_id,\n                    api_base=api_base,\n                    headers=headers,\n                    use_server_proxy=use_server_proxy,\n                    client=client,\n                )\n            except httpx.HTTPStatusError as e:\n                if e.response.status_code != 404:\n                    raise\n                last_error = e\n            except ValueError as e:\n                last_error = e\n\n            if time.monotonic() >= deadline:\n                raise TimeoutError(\n                    f\"OpenSandbox execd endpoint for {sandbox_id} was not ready within {ready_timeout} seconds\"\n                ) from last_error\n            await asyncio.sleep(poll_interval)\n\n    async def _get_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    ) -> tuple[str, dict[str, str]]:\n        response: Final = cast(\n            httpx.Response,\n            await self._http(client).get(\n                url=f\"{api_base}/sandboxes/{sandbox_id}/endpoints/{OPEN_SANDBOX_EXECD_PORT}\",\n                headers=headers,","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/opensandbox/sandbox/transformation.py#L277-L313","documentation":"After a sandbox reaches Running, LiteLLM polls the execd endpoint via GET /sandboxes/{id}/endpoints/{OPEN_SANDBOX_EXECD_PORT}, treating 404 (and transient ValueErrors) as 'not registered yet'. If the ready_timeout deadline passes first, TimeoutError is raised chained (from) the last observed error, so the cause is available via __cause__.","triggerScenarios":"The execd sidecar inside a Running sandbox is slow to register its endpoint, the sandbox image never starts execd on the expected port, or endpoint records replicate slowly in the control plane - every poll 404s until the deadline expires.","commonSituations":"Custom sandbox images that lack the execd service; heavy startup work inside the sandbox delaying execd; control-plane lag during incidents; ready_timeout too small for endpoint registration.","solutions":["Raise ready_timeout for the execd wait","Verify the sandbox image actually runs execd on OPEN_SANDBOX_EXECD_PORT","Inspect e.__cause__ (last 404 or ValueError) to distinguish 'not yet registered' from other failures","Recreate the sandbox if endpoint registration is genuinely stuck"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"Catch TimeoutError and inspect e.__cause__ (the last 404 or ValueError): if it is a 404 pattern, retry with a larger ready_timeout since registration lag is transient; if the cause differs, recreate the sandbox.","preventionTips":["Verify the sandbox image actually starts execd on OPEN_SANDBOX_EXECD_PORT before relying on it","Budget a longer timeout for endpoint registration than for sandbox boot","Distinguish boot timeouts from endpoint-registration timeouts in metrics"],"tags":["opensandbox","sandbox","timeout","execd","endpoint","litellm"],"backgroundTag":"operation-timeout","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}