{"record":{"id":"1043920f2b523844","repo":"sgl-project/sglang","slug":"http-material-body-is-empty-uri","errorCode":null,"errorMessage":"HTTP material body is empty: {uri}","messagePattern":"HTTP material body is empty: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/material_io.py","lineNumber":752,"sourceCode":"            / f\"condition_{int(condition_index):04d}{suffix}\"\n        )\n        partial_path = output_path.with_name(output_path.name + \".partial\")\n        total = 0\n        try:\n            with partial_path.open(\"wb\") as output:\n                while True:\n                    chunk = response.read(MINIMAX_H3_HTTP_READ_CHUNK_BYTES)\n                    if not chunk:\n                        break\n                    if not isinstance(chunk, bytes):\n                        raise TypeError(\n                            \"HTTP material response.read() must return bytes, got \"\n                            f\"{type(chunk).__name__}\"\n                        )\n                    total += len(chunk)\n                    output.write(chunk)\n            if total == 0:\n                raise ValueError(f\"HTTP material body is empty: {uri}\")\n            partial_path.replace(output_path)\n        except Exception:\n            partial_path.unlink(missing_ok=True)\n            output_path.unlink(missing_ok=True)\n            raise\n    return str(output_path)\n\n\ndef minimax_h3_localize_material_uri(\n    batch: Any,\n    uri: str,\n    *,\n    condition_type: str,\n    condition_index: int,\n    timeout_s: float = 120.0,\n) -> str:\n    \"\"\"Return a local path for a canonical condition URI.\n","sourceCodeStart":734,"sourceCodeEnd":770,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/material_io.py#L734-L770","documentation":"The HTTP(S) material download completed but zero body bytes were read, so the asset would be an empty file. The downloader refuses to cache an empty body.","triggerScenarios":"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.","commonSituations":"Expired pre-signed URL that yields an empty 200, misconfigured object-storage endpoint, CDN edge returning empty body, wrong URL.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import urllib.request\nwith urllib.request.urlopen(uri) as r:\n    assert r.read(1), 'empty body'  # precheck","typeGuard":null,"tryCatchPattern":"except ValueError as e:\n    if 'empty' in str(e): refresh pre-signed URL and retry","preventionTips":["Pre-check URLs for expensive batches","Monitor for expired signed URLs"],"tags":["http","empty-response","minimax-h3"],"backgroundTag":"empty-http-response-body","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}