{"record":{"id":"ee641ff41c52d631","repo":"sgl-project/sglang","slug":"tar-material-payload-is-truncated-expected-size","errorCode":null,"errorMessage":"tar material payload is truncated: expected {size} bytes, only {available} available","messagePattern":"tar material payload is truncated: expected (.+?) bytes, only (.+?) available","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":667,"sourceCode":"\ndef _stream_tar_member_material(\n    batch: Any,\n    uri: str,\n    *,\n    condition_type: str,\n    condition_index: int,\n) -> str:\n    source_path, offset, size, member = _parse_tar_member_uri(uri)\n    if size <= 0:\n        raise ValueError(\"tar material payload is empty\")\n    if not source_path.is_file():\n        raise FileNotFoundError(\n            f\"tar material source does not exist or is not a file: {source_path}\"\n        )\n    source_size = source_path.stat().st_size\n    if offset > source_size or size > source_size - offset:\n        available = max(0, source_size - offset)\n        raise ValueError(\n            f\"tar material payload is truncated: expected {size} bytes, \"\n            f\"only {available} available\"\n        )\n\n    output_path, partial_path = _material_output_paths(\n        batch,\n        condition_type=condition_type,\n        condition_index=condition_index,\n        source_name=member,\n    )\n    remaining = size\n    try:\n        with source_path.open(\"rb\") as source, partial_path.open(\"wb\") as output:\n            source.seek(offset)\n            while remaining:\n                chunk = source.read(min(MINIMAX_H3_HTTP_READ_CHUNK_BYTES, remaining))\n                if not chunk:\n                    raise ValueError(","sourceCodeStart":649,"sourceCodeEnd":685,"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#L649-L685","documentation":"The tar file is smaller than the declared member offset+size, i.e. the pre-flight bounds check against source file stat size failed. The archive cannot contain the requested byte range.","triggerScenarios":"A tar-member URI whose offset/size exceed source_path.stat().st_size — e.g. the tar was replaced with an older/smaller file after the URI was minted.","commonSituations":"Truncated upload/download of the tar, partial rsync copy, or stale URI generated against a different (larger) version of the archive.","solutions":["Re-download or restore the full tar archive and compare its size/checksum","Regenerate the tar-member URIs against the current archive","Verify no process is rewriting the tar concurrently"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"st = source.stat().st_size\nassert 0 <= offset and 0 < size <= st - offset, 'range outside archive'","typeGuard":null,"tryCatchPattern":"except ValueError as e: re-fetch/regenerate the archive and URI","preventionTips":["Pin archive checksums; regenerate URIs when archives change"],"tags":["tar","truncation","minimax-h3"],"backgroundTag":"file-truncated","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}