{"record":{"id":"0f00a09a0309bdda","repo":"sgl-project/sglang","slug":"row-i-e","errorCode":null,"errorMessage":"row {i}: {e}","messagePattern":"row \\{i\\}: \\{e\\}","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/utils/field_validators.py","lineNumber":79,"sourceCode":"    \"\"\"Validates type: list[int] | list[list[int]] | None\"\"\"\n    if v is None:\n        # Accept None\n        return v\n    if not isinstance(v, list):\n        raise ValueError(f\"must be list or null; got {type(v).__name__}\")\n    if not v:\n        # Accept empty list\n        return v\n    if isinstance(v[0], int):\n        # Accept list[int]\n        return validate_list_i64_1d(v)\n    if isinstance(v[0], list):\n        # Accept list[list[int]]\n        for i, row in enumerate(v):\n            try:\n                validate_list_i64_1d(row)\n            except ValueError as e:\n                raise ValueError(f\"row {i}: {e}\") from None\n        return v\n    raise ValueError(f\"elements must be int or list; got {type(v[0]).__name__}\")\n","sourceCodeStart":61,"sourceCodeEnd":82,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/utils/field_validators.py#L61-L82","documentation":"A 2D int-list field passed validation of the outer list, but one row failed validate_list_i64_1d (not a list, contains non-ints, or mixed element types). The message embeds the failing row index and the inner error.","triggerScenarios":"Passing list[list[int]] where a row contains floats, strings, booleans mixed with ints, or a row is not a list, e.g. [[1,2],[3,'4']].","commonSituations":"JSON configs where one row was hand-edited and contains a float like 1.0 or a string '2', or a row accidentally flattened.","solutions":["Look at row {i} in the message and fix the reported element type","Ensure every row is a list of plain ints (no floats/strings/None)","Validate the structure in your config loader before passing to sglang"],"exampleFix":"# before\nvalue = [[1, 2], [3, 4.0]]\n# after\nvalue = [[1, 2], [3, 4]]","handlingStrategy":"validation","validationCode":"def valid_2d(v):\n    return all(isinstance(r, list) and all(isinstance(x, int) and not isinstance(x, bool) for x in r) for r in v)","typeGuard":"def is_i64_2d(v) -> TypeGuard[list[list[int]]]:\n    return isinstance(v, list) and all(isinstance(r, list) and all(type(x) is int for x in r) for r in v)","tryCatchPattern":"try:\n    validate_optional_list_i64_1d_2d(v)\nexcept ValueError as e:\n    raise ConfigError(str(e)) from e","preventionTips":["Normalize JSON floats to ints when loading configs","Reject mixed-type rows in your config linter"],"tags":["validation","config","nested-list"],"backgroundTag":"nested-list-validation-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}