sgl-project/sglang · error · RuntimeError

{response.error}

Error message

{response.error}

What it means

Raised by infer_action when the scheduler response carries a non-empty `error` field after forwarding an action-inference request. The scheduler/client side reported a failure (e.g. model error, request rejected, backend exception) and this endpoint propagates it as a RuntimeError with the upstream message. It means the request reached the scheduler but failed during policy inference.

Source

Thrown at python/sglang/multimodal_gen/runtime/entrypoints/action/protocol.py:422

            payload,
            _action_request_to_observation(payload),
            server_args,
            sampling_params_cls,
        )
    raise ValueError(
        f"Action endpoint is not implemented for {sampling_params_cls.__name__}"
    )


async def infer_action(
    payload: dict[str, Any],
    server_args: ServerArgs,
) -> dict[str, Any]:
    sp = build_action_sampling_params(payload, server_args)
    req = prepare_request(server_args, sp)
    response = await async_scheduler_client.forward(req)
    if getattr(response, "error", None):
        raise RuntimeError(response.error)
    if response.output is None:
        raise RuntimeError("action policy returned no output")
    return response.output[0]


def action_generation_response(
    output: dict[str, Any],
    server_args: ServerArgs,
    *,
    preserve_numpy: bool = False,
) -> dict[str, Any]:
    actions = output["actions"]
    action_array = np.asarray(actions)
    if any(size == 0 for size in action_array.shape):
        raise ValueError(
            "action output dimensions must be non-zero, got "
            f"{tuple(action_array.shape)}"
        )

View on GitHub (pinned to 0132848349)

Solutions

  1. Inspect the propagated response.error string — it contains the underlying scheduler-side failure message; fix that root cause
  2. Verify the action policy model is loaded correctly on the scheduler (check server logs around the failing request)
  3. Check that payload/server_args passed to build_action_sampling_params produce valid sampling parameters
  4. Restart or reconnect to the scheduler if it crashed mid-request
Defensive patterns

Strategy: try-catch

Validate before calling

resp = await async_scheduler_client.forward(ping_req)
if getattr(resp, "error", None):
    # surface or retry before running real inference
    ...

Try / catch

try:
    out = await infer_action(client, payload, server_args)
except RuntimeError as e:
    log.error("action inference failed: %s", e)
    # degrade gracefully / retry with backoff if transient

Prevention

When it happens

Trigger: Calling create_action_generation or the action msgpack WebSocket endpoint (run_action_msgpack_ws) when async_scheduler_client.forward(req) returns a response object whose `.error` attribute is set — e.g. malformed sampling params rejected server-side, model load failure, or an inference exception in the action policy model.

Common situations: Server-side model exceptions (OOM, checkpoint mismatch), invalid sampling parameters built by build_action_sampling_params, scheduler restarting or partially crashed mid-request, version mismatch between client protocol and scheduler.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/7267d65545adc860. Report an issue: GitHub.