sgl-project/sglang · error · ValueError
{path} must be a non-empty string
Error message
{path} must be a non-empty string What it means
The canonical-request validator requires certain string fields (identified by the JSON path in the message) to be non-empty strings. _require_str rejects None, non-str types, and empty strings.
Source
Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/request_validation.py:48
MINIMAX_H3_TASK_T2VA,
MiniMaxH3TaskProfile,
canonical_minimax_h3_task,
minimax_h3_task_profile,
)
from sglang.multimodal_gen.runtime.pipelines_core.stages.model_specific_stages.minimax_h3.time_request import (
minimax_h3_align_frame_count,
)
MINIMAX_H3_REQUEST_SCHEMA = "minimax_h3.request/v1"
MINIMAX_H3_MAX_SIGNED_SEED = (1 << 63) - 1
_ALLOWED_CONDITION_KEYS = frozenset(
{"type", "uri", "role", "frame_index", "start_time_seconds"}
)
def _require_str(value: Any, path: str) -> str:
if not isinstance(value, str) or value == "":
raise ValueError(f"{path} must be a non-empty string")
return value
def _require_int(value: Any, path: str) -> int:
if isinstance(value, bool) or not isinstance(value, int):
raise ValueError(f"{path} must be an integer")
return value
def _optional_positive_finite_float(value: Any, path: str) -> float | None:
if value is None:
return None
if isinstance(value, bool) or not isinstance(value, (int, float)):
raise ValueError(f"{path} must be a number")
normalized = float(value)
if not math.isfinite(normalized) or normalized <= 0.0:
raise ValueError(f"{path} must be a positive finite number")
return normalizedView on GitHub (pinned to 0132848349)
Solutions
- Find the field at the path in the message and supply a non-empty string
- Treat these fields as required in your client schema, not nullable
- Strip nulls before validation if your transport inserts them
Example fix
# before
{"target": {"uri": None}}
# after
{"target": {"uri": "file://video.mp4"}} Defensive patterns
Strategy: type-guard
Validate before calling
def clean(req: dict) -> dict:
for p in ["target.uri", "target.type", "target.role"]:
v = get_path(req, p)
assert isinstance(v, str) and v, f"{p} must be a non-empty string"
return req Type guard
def non_empty_str(v: Any) -> bool:
return isinstance(v, str) and v != "" Prevention
- Use a typed client model (pydantic) for canonical requests
- Reject nulls for required string fields at deserialization
When it happens
Trigger: Calling minimax_h3_validate_canonical_request (or _validate_target/_validate_conditions) with e.g. target.uri = None, type = 3, or role = "" — the message names the exact path.
Common situations: Partial request payloads, optional fields serialized as null by a JSON client, or fields dropped then defaulted to None upstream.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- {path} is required and must be an object
- MiniMax H3 request task must be a non-empty string
- MiniMax H3 requires num_inference_steps >= 2 because its vid
- quality must be one of {list(QUALITY_LEVELS)}, got {quality!
- {path} must be an integer
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/1702b02d450a053d.
Report an issue: GitHub.