{"record":{"id":"3028b1d0d4cf4a90","repo":"sgl-project/sglang","slug":"tar-material-uri-must-contain-tar-path-encoded","errorCode":null,"errorMessage":"tar material URI must contain '<tar_path>:<encoded_header>'","messagePattern":"tar material URI must contain '<tar_path>:<encoded_header>'","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":159,"sourceCode":"        value = ord(character)\n        if value not in _BASE64_ALPHABET:\n            raise ValueError(\n                f\"material URI has an invalid base64 character {character!r}\"\n            )\n        yield value\n\n\ndef _parse_tar_member_uri(uri: str) -> tuple[Path, int, int, str | None]:\n    if uri.startswith(\"tar+offset://\"):\n        prefix = \"tar+offset://\"\n    elif uri.startswith(\"tar+b64header://\"):\n        prefix = \"tar+b64header://\"\n    else:\n        raise ValueError(\"unsupported tar material URI\")\n    try:\n        tar_path, encoded_header = uri[len(prefix) :].rsplit(\":\", 1)\n    except ValueError as exc:\n        raise ValueError(\n            \"tar material URI must contain '<tar_path>:<encoded_header>'\"\n        ) from exc\n    if len(encoded_header) > MINIMAX_H3_TAR_HEADER_MAX_ENCODED_CHARS:\n        raise ValueError(\"tar material URI encoded header is too large\")\n    padded = encoded_header + \"=\" * (-len(encoded_header) % 4)\n    try:\n        header = json.loads(\n            base64.b64decode(\n                padded.encode(\"ascii\"), altchars=b\"-_\", validate=True\n            ).decode(\"utf-8\")\n        )\n    except Exception as exc:\n        raise ValueError(\"tar material URI has an invalid encoded header\") from exc\n    if not isinstance(header, dict):\n        raise ValueError(\"tar material URI header must be a JSON object\")\n    if header.get(\"schema\") != \"sglang.tar_member_ref/v1\":\n        raise ValueError(\n            f\"unsupported tar material header schema: {header.get('schema')!r}\"","sourceCodeStart":141,"sourceCodeEnd":177,"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#L141-L177","documentation":"After stripping the tar scheme prefix, the remainder must be '<tar_path>:<encoded_header>' — splittable on the last ':'. If there is no ':' at all, rsplit(':',1) yields a single element and the unpack raises, re-raised as this ValueError.","triggerScenarios":"A tar URI like 'tar+offset:///data/x.tar' where the ':<encoded_header>' suffix was omitted, or a header separator replaced by another delimiter.","commonSituations":"Producer changes that dropped the header suffix, path formats using a different separator, or hand-crafted URIs in tests/tools.","solutions":["Append the encoded header: 'tar+offset://{tar_path}:{offset}:{size}' style header per the expected format","Regenerate tar member URIs with the library's builder instead of string formatting","Validate the URI contains ':' after the scheme prefix before submitting"],"exampleFix":"// before\nuri = f\"tar+offset://{tar_path}\"\n// after\nuri = f\"tar+offset://{tar_path}:{offset}:{size}\"","handlingStrategy":"validation","validationCode":"rest = uri.split('://', 1)[1] if '://' in uri else uri\nassert ':' in rest, 'tar URI missing :<encoded_header> suffix'","typeGuard":"def tar_uri_has_header(uri: str) -> bool:\n    return uri.startswith(('tar+offset://', 'tar+b64header://')) and ':' in uri.split('://', 1)[1]","tryCatchPattern":null,"preventionTips":["Always append the header segment when building tar URIs","Use library builders instead of f-strings"],"tags":["minimax-h3","tar-uri","parsing","material-io"],"backgroundTag":"malformed-uri-format","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}