BerriAI/litellm · error · ValueError

OpenSandbox did not return an execd endpoint for {sandbox_id

Error message

OpenSandbox did not return an execd endpoint for {sandbox_id}

What it means

LiteLLM fetches the execd endpoint with GET /sandboxes/{id}/endpoints/{OPEN_SANDBOX_EXECD_PORT} and reads the 'endpoint' field from the JSON body. If that field is missing, null, or empty, it raises ValueError because it cannot construct the URL to talk to the sandbox. The HTTP call itself succeeded - the payload is just unusable.

Source

Thrown at litellm/llms/opensandbox/sandbox/transformation.py:320

        *,
        sandbox_id: str,
        api_base: str,
        headers: dict[str, str],
        use_server_proxy: bool,
        client: AsyncHTTPHandler | None,
    ) -> tuple[str, dict[str, str]]:
        response: Final = cast(
            httpx.Response,
            await self._http(client).get(
                url=f"{api_base}/sandboxes/{sandbox_id}/endpoints/{OPEN_SANDBOX_EXECD_PORT}",
                headers=headers,
                params={"use_server_proxy": use_server_proxy},
            ),
        )
        data: Final = response.json()
        endpoint: Final = data.get("endpoint")
        if not endpoint:
            raise ValueError(f"OpenSandbox did not return an execd endpoint for {sandbox_id}")
        return str(endpoint), self._as_str_dict(data.get("headers"))

    async def _post_code(
        self,
        *,
        url: str,
        headers: dict[str, str],
        body: dict[str, object],
        client: AsyncHTTPHandler | None,
    ) -> list[str]:
        timeout: Final = httpx.Timeout(connect=30.0, read=None, write=30.0, pool=None)
        response: Final = cast(
            httpx.Response,
            await self._http(client).post(
                url=url,
                headers=headers,
                timeout=timeout,
                json=body,

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Manually GET the endpoints URL with the same lifecycle headers to inspect the actual payload
  2. Confirm the execd port is correct and the sandbox image exposes it
  3. Retry - empty endpoint records are often transient right after registration
  4. Recreate the sandbox if the record stays empty
Defensive patterns

Strategy: retry

Try / catch

Catch ValueError with 'did not return an execd endpoint' and retry the endpoint fetch after a short delay - empty records right after registration are often transient; if it persists, delete and recreate the sandbox.

Prevention

When it happens

Trigger: The control plane returns HTTP 200 with an error object or partial record instead of an endpoint field; querying a port the sandbox never opened; schema drift in the OpenSandbox endpoints API returning a renamed field.

Common situations: Provider API changes renaming 'endpoint'; regional endpoints returning empty records during incidents; racing against sandbox teardown so the record exists but is empty.

Related errors


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/f8e5f33c0db1cd71. Report an issue: GitHub.