sgl-project/sglang · error · ValueError

{path} requires at least one entry for task {profile.task!r}

Error message

{path} requires at least one entry for task {profile.task!r}

What it means

The task requires conditions (conditions_required true, no special minimum) but the list is empty. Reference-driven tasks need at least one keyframe/reference entry.

Source

Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/request_validation.py:161

    *,
    profile: MiniMaxH3TaskProfile,
    frame_count: int | None,
) -> list[dict[str, Any]]:
    path = "conditions"
    if conditions is None:
        conditions = []
    if not isinstance(conditions, Sequence) or isinstance(conditions, (str, bytes)):
        raise ValueError(f"{path} must be a list")

    if not profile.conditions_required:
        if len(conditions) > 0:
            raise ValueError(
                f"{path} must be empty for task {profile.task!r} "
                f"(got {len(conditions)} entries)"
            )
        return []
    if len(conditions) == 0:
        raise ValueError(
            f"{path} requires at least one entry for task {profile.task!r}"
        )
    if (
        profile.min_condition_count is not None
        and len(conditions) < profile.min_condition_count
    ):
        raise ValueError(
            f"{path} requires at least {profile.min_condition_count} entries "
            f"for task {profile.task!r}, got {len(conditions)}"
        )
    if (
        profile.max_condition_count is not None
        and len(conditions) > profile.max_condition_count
    ):
        raise ValueError(
            f"{path} allows at most {profile.max_condition_count} entries "
            f"for task {profile.task!r}, got {len(conditions)}"
        )

View on GitHub (pinned to 0132848349)

Solutions

  1. Add at least one valid condition entry with role/type/uri
  2. If you intended text-only generation, use the text-only task instead

Example fix

// before
"conditions": []
// after
"conditions": [{"role": "reference", "type": "image", "uri": "ref.png"}]
Defensive patterns

Strategy: validation

Validate before calling

if profile.conditions_required and not conditions:
    raise ValueError('this task requires at least one condition')

Prevention

When it happens

Trigger: Submitting an image/video-conditioned task (e.g. ref2va) with conditions omitted or [].

Common situations: Defaulting conditions to [] universally; forgetting to attach the reference image after moving file upload code.

Understand the failure class

Background: "Missing required field" and "field is required" errors: why libraries reject payloads that omit mandatory fields — this error's family across 20 libraries.

Related errors


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