{"record":{"id":"615563b94ff530dc","repo":"sgl-project/sglang","slug":"unsupported-config-option-key-norm-with-action","errorCode":null,"errorMessage":"Unsupported config option '{key_norm}' with action '{action.__class__.__name__}'","messagePattern":"Unsupported config option '(.+?)' with action '(.+?)'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/utils/server_args_config_parser.py","lineNumber":150,"sourceCode":"    def _validate_yaml_file(self, file_path: str) -> None:\n        \"\"\"Validate that the file is a YAML file.\"\"\"\n        path = Path(file_path)\n        if path.suffix.lower() not in [\".yaml\", \".yml\"]:\n            raise ValueError(f\"Config file must be YAML format, got: {path.suffix}\")\n\n        if not path.exists():\n            raise ValueError(f\"Config file not found: {file_path}\")\n\n    def _convert_config_to_args(self, config: Dict[str, Any]) -> List[str]:\n        \"\"\"Convert configuration dictionary to argument list.\"\"\"\n        args = []\n\n        for key, value in config.items():\n            key_norm = key.replace(\"-\", \"_\")\n            if key_norm in self.unsupported_actions:\n                action = self.unsupported_actions[key_norm]\n                msg = f\"Unsupported config option '{key_norm}' with action '{action.__class__.__name__}'\"\n                raise ValueError(msg)\n            if isinstance(value, bool):\n                self._add_boolean_arg(args, key, value)\n            elif isinstance(value, list):\n                self._add_list_arg(args, key, value)\n            elif isinstance(value, dict):\n                self._add_scalar_arg(args, key, json.dumps(value))\n            else:\n                self._add_scalar_arg(args, key, value)\n\n        return args\n\n    def _add_boolean_arg(self, args: List[str], key: str, value: bool) -> None:\n        \"\"\"\n        Add boolean argument to the list.\n\n        Only store_true flags:\n            - value True -> add flag\n            - value False -> skip","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/utils/server_args_config_parser.py#L132-L168","documentation":"Some argparse actions (e.g. custom store/append actions) cannot be represented in a YAML config, so the parser keeps a deny-list (unsupported_actions keyed by normalized key names). Any config key landing in that dict raises with the action class name. It fires before value-type dispatch (bool/list/dict/scalar).","triggerScenarios":"Including a denied key (with dashes normalized to underscores) in the YAML config whose argparse action class is in the parser's unsupported_actions mapping.","commonSituations":"Copying a full --help dump into YAML, including flags whose action type (e.g. special append or custom action classes) is unsupported in config form; version drift adding newly unsupported options.","solutions":["Remove the offending key from the YAML file and pass it as a CLI flag instead","Check the parser's unsupported_actions dict for the exact set of denied keys","Upgrade/downgrade sglang to a version where that option's action is supported in configs"],"exampleFix":"# before (config.yaml)\nsome-append-action: [a, b]\n# after\n# remove from config.yaml and pass on CLI:\npython -m sglang.launch_server --config config.yaml --some-append-action a --some-append-action b","handlingStrategy":"validation","validationCode":"unsupported = parser.unsupported_actions  # normalized keys\nbad = [k for k in config if k.replace(\"-\", \"_\") in unsupported]\nassert not bad, f\"unsupported config keys: {bad}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass exotic argparse-action flags on the CLI only","Re-check unsupported_actions after sglang upgrades"],"tags":["sglang","yaml","config","argparse","unsupported-option"],"backgroundTag":"unsupported-config-option","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}