sgl-project/sglang · error · ValueError

{label} is empty: {path}

Error message

{label} is empty: {path}

What it means

The material file exists but has st_size <= 0, so it cannot contain valid media. Raised by _checked_material_file to fail fast instead of letting the image/video decoder produce confusing errors.

Source

Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/material_io.py:211

    )


def _safe_suffix(value: str | None) -> str | None:
    if not value:
        return None
    suffix = Path(urllib.parse.urlsplit(value).path).suffix.lower()
    if suffix and len(suffix) <= 10 and suffix[1:].isalnum():
        return suffix
    return None


def _checked_material_file(path: Path, *, label: str) -> str:
    """Validate that a localized source exists and is non-empty."""

    if not path.is_file():
        raise FileNotFoundError(f"{label} does not exist or is not a file: {path}")
    if path.stat().st_size <= 0:
        raise ValueError(f"{label} is empty: {path}")
    return str(path)


def _parse_frame_rate(value: Any) -> float:
    if value in {None, "", "N/A", "0/0"}:
        return 0.0
    raw = str(value)
    try:
        if "/" in raw:
            numerator, denominator = raw.split("/", 1)
            denominator_value = float(denominator)
            parsed = float(numerator) / denominator_value if denominator_value else 0.0
        else:
            parsed = float(raw)
        return parsed if math.isfinite(parsed) else 0.0
    except (TypeError, ValueError, ZeroDivisionError):
        return 0.0

View on GitHub (pinned to 0132848349)

Solutions

  1. Re-download or re-extract the material file and verify non-zero size
  2. Delete empty placeholder files from the material directory
  3. Check disk space / extraction logs if files are systematically empty
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path
assert Path(local_path).stat().st_size > 0

Try / catch

try:
    minimax_h3_localize_material_uri(uri)
except ValueError as e:
    if "is empty" in str(e):
        re_fetch(uri)

Prevention

When it happens

Trigger: A zero-byte file (or a file that stat()s to 0, like /dev/null-like nodes) passed as a MiniMax H3 material source.

Common situations: Interrupted downloads, placeholder files created by touch, truncated extraction from an archive, or wrong file picked up during staging.

Related errors


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