{"record":{"id":"82bc4f051043e9b2","repo":"sgl-project/sglang","slug":"no-config-file-specified-after-config-flag","errorCode":null,"errorMessage":"No config file specified after --config flag!","messagePattern":"No config file specified after --config flag!","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/utils/server_args_config_parser.py","lineNumber":97,"sourceCode":"        before_config = cli_args[:config_index]\n        after_config = cli_args[config_index + 2 :]  # Skip --config and file path\n\n        # Simple merge: config args + CLI args\n        return config_args + before_config + after_config\n\n    def _extract_config_file_path(self, args: List[str]) -> str:\n        \"\"\"Extract the config file path from arguments.\"\"\"\n        config_indices = [i for i, arg in enumerate(args) if arg == \"--config\"]\n\n        if len(config_indices) > 1:\n            raise ValueError(\"Multiple config files specified! Only one allowed.\")\n\n        if not config_indices:\n            return None\n\n        config_index = config_indices[0]\n        if config_index == len(args) - 1:\n            raise ValueError(\"No config file specified after --config flag!\")\n\n        return args[config_index + 1]\n\n    def _parse_yaml_config(self, file_path: str) -> Dict[str, Any]:\n        \"\"\"\n        Parse YAML configuration file and convert to argument list.\n\n        Args:\n            file_path: Path to the YAML configuration file\n\n        Returns:\n            List of arguments in format ['--key', 'value', ...]\n\n        Raises:\n            ValueError: If file is not YAML or cannot be read\n        \"\"\"\n        self._validate_yaml_file(file_path)\n","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/utils/server_args_config_parser.py#L79-L115","documentation":"The --config flag must be immediately followed by a file path. If --config is the last token in argv there is no value to consume, so the parser raises before attempting to open anything.","triggerScenarios":"A command line ending in --config, e.g. `... --config`, or a script that appends --config before a variable that expanded to empty.","commonSituations":"Typo/truncated command line, or `--config $CONFIG_FILE` where CONFIG_FILE is unset, leaving --config dangling.","solutions":["Supply the path right after --config: `--config config.yaml`","Verify the config-path variable is set before building the command line"],"exampleFix":"# before\npython -m sglang.launch_server --model-path m --config\n# after\npython -m sglang.launch_server --model-path m --config config.yaml","handlingStrategy":"validation","validationCode":"i = args.index(\"--config\") if \"--config\" in args else -1\nassert i == -1 or i + 1 < len(args), \"--config must be followed by a path\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use argparse-style `--config=path` form which cannot dangle","Fail fast in wrapper scripts when config-path variables are empty"],"tags":["sglang","cli","missing-argument"],"backgroundTag":"missing-cli-argument","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}