{"record":{"id":"164a3a5c6916972a","repo":"sgl-project/sglang","slug":"invalid-config-pair-missing-pair-r","errorCode":null,"errorMessage":"Invalid config pair (missing '='): {pair!r}","messagePattern":"Invalid config pair \\(missing '='\\): (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/debug_utils/dumper.py","lineNumber":113,"sourceCode":"        return raw\n\n    @classmethod\n    def from_kv_pairs(cls, pairs: Optional[List[str]]) -> \"_BaseConfig\":\n        return cls(**cls._kv_pairs_to_dict(pairs))\n\n    @classmethod\n    def _kv_pairs_to_dict(cls, pairs: Optional[List[str]]) -> dict:\n        if not pairs:\n            return {}\n\n        missing = object()\n        defaults = {f.name: f.default for f in fields(cls)}\n        result: dict = {}\n\n        for pair in pairs:\n            key, sep, value = pair.partition(\"=\")\n            if not sep:\n                raise ValueError(f\"Invalid config pair (missing '='): {pair!r}\")\n            default = defaults.get(key, missing)\n            if default is missing:\n                raise ValueError(\n                    f\"Unknown config key {key!r}. Valid keys: {sorted(defaults)}\"\n                )\n            try:\n                result[key] = cls._parse_env_value(value, default)\n            except (ValueError, TypeError) as exc:\n                field_type = type(default).__name__\n                raise TypeError(f\"{key}: expected {field_type}, got {value!r}\") from exc\n\n        return result\n\n\n_DEFAULT_EXP_NAME_PREFIX = \"dump_\"\n\n\n@dataclass(frozen=True)","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/debug_utils/dumper.py#L95-L131","documentation":"Raised by DumpConfig.from_kv_pairs when parsing a 'key=value' config string. The input is split on '=' via str.partition; if no '=' separator exists in a pair, the pair cannot be split into key and value and the parser rejects it immediately. This is a strict format check on kv-pair strings (used for CLI args and env-style config).","triggerScenarios":"Calling from_kv_pairs(['phase']) or passing a config string like 'phase' without '=value'; any list element lacking an '=' character.","commonSituations":"Typos in CLI flags or env vars consumed by the debug dumper (e.g. SGLANG_DUMP_CONFIG='phase' instead of 'phase=decode'); forgetting the value part of a pair.","solutions":["Add an '=' and a value to every pair, e.g. 'phase=decode'","Check for stray whitespace or a missing value in the pair string","If you intended a boolean flag, still write 'flag=true' explicitly"],"exampleFix":"// before\ncfg = DumpConfig.from_kv_pairs([\"phase\"])\n// after\ncfg = DumpConfig.from_kv_pairs([\"phase=decode\"])","handlingStrategy":"validation","validationCode":"pairs = [\"phase=decode\"]\nassert all(\"=\" in p for p in pairs), f\"missing '=' in {[p for p in pairs if '=' not in p]}\"\ncfg = DumpConfig.from_kv_pairs(pairs)","typeGuard":null,"tryCatchPattern":"try:\n    cfg = DumpConfig.from_kv_pairs(pairs)\nexcept ValueError as e:\n    if \"missing '='\" in str(e):\n        raise SystemExit(f\"bad config pair: {e}\") from e\n    raise","preventionTips":["Always build kv pairs as f\"{key}={value}\" rather than concatenating by hand","Validate pair strings with '=' membership before passing them in"],"tags":["config","validation","debug-utils"],"backgroundTag":"invalid-config-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}