{"record":{"id":"e3a265303f737866","repo":"sgl-project/sglang","slug":"batching-config-schema-version-must-be-1","errorCode":null,"errorMessage":"batching config schema_version must be 1","messagePattern":"batching config schema_version must be 1","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/managers/dynamic_batch_admission.py","lineNumber":284,"sourceCode":"\ndef load_batching_config(path: str | None) -> list[BatchingRule]:\n    if path is None:\n        return []\n\n    with open(path, encoding=\"utf-8\") as f:\n        payload = json.load(f)\n\n    source = os.path.abspath(path)\n    entries = _config_entries(payload)\n    rules = [BatchingRule.from_dict(entry, source=source) for entry in entries]\n    if not rules:\n        raise ValueError(f\"batching config {source} does not contain any rules\")\n    return rules\n\n\ndef _config_entries(payload: Any) -> list[dict[str, Any]]:\n    if isinstance(payload, dict) and payload.get(\"schema_version\") not in (None, 1):\n        raise ValueError(\"batching config schema_version must be 1\")\n    if isinstance(payload, dict) and isinstance(payload.get(\"rules\"), list):\n        return payload[\"rules\"]\n    if isinstance(payload, list):\n        return payload\n    if isinstance(payload, dict):\n        entries: list[dict[str, Any]] = []\n        for key, value in payload.items():\n            if key == \"schema_version\" or not isinstance(value, dict):\n                continue\n            model, _sep, resolution = key.partition(\"|\")\n            entry = dict(value)\n            if model:\n                entry.setdefault(\"model\", model)\n            if resolution:\n                entry.setdefault(\"resolution\", resolution)\n            entries.append(entry)\n        return entries\n    raise ValueError(","sourceCodeStart":266,"sourceCodeEnd":302,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/managers/dynamic_batch_admission.py#L266-L302","documentation":"If the config payload is a dict with a schema_version field, that field must be 1 (or absent, which is treated as 1). _config_entries raises for any other version because no other schema is supported.","triggerScenarios":"A config file like {\"schema_version\": 2, \"rules\": [...]} or schema_version as a string \"1\" (not in (None, 1)).","commonSituations":"Config written for/forward-ported from a newer tool version; schema_version stored as a string by a config generator; hand-bumped version numbers.","solutions":["Set \"schema_version\": 1 (integer) or remove the key","If the config genuinely uses a newer schema, regenerate it with the version of the library you run"],"exampleFix":"// before\n{\"schema_version\": \"1\", \"rules\": [...]}\n// after\n{\"schema_version\": 1, \"rules\": [...]}","handlingStrategy":"validation","validationCode":"v = payload.get(\"schema_version\") if isinstance(payload, dict) else None\nif v not in (None, 1):\n    raise SystemExit(f\"unsupported schema_version {v!r}; must be integer 1\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep schema_version as an unquoted integer in JSON"],"tags":["config","schema-version","batching","version-mismatch"],"backgroundTag":"unsupported-schema-version","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}