sgl-project/sglang · error · ValueError
HTTP material body is empty
Error message
HTTP material body is empty: {uri} What it means
The HTTP material body was empty for the given URI. Verify the URL returns actual content.
Solutions
- curl -i the URL and inspect status/body
- Regenerate the pre-signed URL or fix the object key
- Check proxy/CDN interference for the host
Defensive patterns
Strategy: validation
Validate before calling
import urllib.request
with urllib.request.urlopen(uri) as r:
assert r.read(1), 'empty body' # precheck Try / catch
except ValueError as e:
if 'empty' in str(e): refresh pre-signed URL and retry Prevention
- Pre-check URLs for expensive batches
- Monitor for expired signed URLs
When it happens
Trigger: The URL returns 200 with an empty body, or a redirect/proxy returns an empty page; total == 0 after the read loop in _stream_http_material.
Common situations: Expired pre-signed URL that yields an empty 200, misconfigured object-storage endpoint, CDN edge returning empty body, wrong URL.
Related errors
- adaln out_features mismatch
- adapt_shape_v1 ratio must be within the inclusive range 1:4…
- aligned video noise shape
- An input image is required for mesh generation
- attention_head_dim must be positive.
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/1043920f2b523844.
Report an issue: GitHub.
Appendix: source
Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/material_io.py:752
/ f"condition_{int(condition_index):04d}{suffix}"
)
partial_path = output_path.with_name(output_path.name + ".partial")
total = 0
try:
with partial_path.open("wb") as output:
while True:
chunk = response.read(MINIMAX_H3_HTTP_READ_CHUNK_BYTES)
if not chunk:
break
if not isinstance(chunk, bytes):
raise TypeError(
"HTTP material response.read() must return bytes, got "
f"{type(chunk).__name__}"
)
total += len(chunk)
output.write(chunk)
if total == 0:
raise ValueError(f"HTTP material body is empty: {uri}")
partial_path.replace(output_path)
except Exception:
partial_path.unlink(missing_ok=True)
output_path.unlink(missing_ok=True)
raise
return str(output_path)
def minimax_h3_localize_material_uri(
batch: Any,
uri: str,
*,
condition_type: str,
condition_index: int,
timeout_s: float = 120.0,
) -> str:
"""Return a local path for a canonical condition URI.
View on GitHub (pinned to 0132848349)