{"record":{"id":"5d2207403d12efeb","repo":"sgl-project/sglang","slug":"material-uri-decoded-payload-is-empty","errorCode":null,"errorMessage":"material URI decoded payload is empty","messagePattern":"material URI decoded payload 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":637,"sourceCode":"                    raise ValueError(\"material URI has data after base64 padding\")\n                encoded_chunk.append(value)\n                if len(encoded_chunk) == MINIMAX_H3_BASE64_DECODE_CHUNK_CHARS:\n                    decoded_chunk = _decode_base64_chunk(encoded_chunk)\n                    total += len(decoded_chunk)\n                    output.write(decoded_chunk)\n                    encoded_chunk.clear()\n            if encoded_size == 0:\n                raise ValueError(\"material URI base64 payload is empty\")\n            if encoded_size % 4 == 1 or (padding and encoded_size % 4):\n                raise ValueError(\"material URI has an invalid base64 payload length\")\n            if encoded_chunk:\n                encoded_chunk.extend(b\"=\" * (-len(encoded_chunk) % 4))\n                decoded_chunk = _decode_base64_chunk(encoded_chunk)\n                total += len(decoded_chunk)\n                output.write(decoded_chunk)\n        decoded_size = (encoded_size * 3) // 4 - padding\n        if decoded_size <= 0:\n            raise ValueError(\"material URI decoded payload is empty\")\n        if total != decoded_size:\n            raise ValueError(\n                f\"MiniMax H3 base64 decoded size {total} != expected {decoded_size}\"\n            )\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 _stream_tar_member_material(\n    batch: Any,\n    uri: str,\n    *,\n    condition_type: str,\n    condition_index: int,","sourceCodeStart":619,"sourceCodeEnd":655,"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#L619-L655","documentation":"After decoding, the computed decoded size ((encoded_size*3)//4 - padding) is zero or negative, meaning the payload carried no actual bytes (e.g. only padding like '====' slipped through earlier checks).","triggerScenarios":"A payload consisting solely of '=' characters, or encoded_size so small relative to padding that decoded_size <= 0.","commonSituations":"Corrupted data URI where the real payload was lost but padding remains; test fixtures with placeholder base64.","solutions":["Regenerate the data URI from the real asset","Validate decoded length > 0 before submission","Check for double-encoding bugs that strip content but keep padding"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"decoded = base64.b64decode(payload + '=' * (-len(payload) % 4))\nassert decoded, 'decodes to empty'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify decoded byte length > 0 before submission"],"tags":["base64","empty-decode","minimax-h3"],"backgroundTag":"invalid-base64-payload","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}