{"record":{"id":"afba980e065ec367","repo":"sgl-project/sglang","slug":"config-file-not-found-file-path","errorCode":null,"errorMessage":"Config file not found: {file_path}","messagePattern":"Config file not found: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/utils/server_args_config_parser.py","lineNumber":139,"sourceCode":"            raise\n\n        # Handle empty files or None content\n        if config_data is None:\n            config_data = {}\n\n        if not isinstance(config_data, dict):\n            raise ValueError(\"Config file must contain a dictionary at root level\")\n\n        return config_data\n\n    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:","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/utils/server_args_config_parser.py#L121-L157","documentation":"After suffix validation, the parser checks existence and raises if the path does not exist on disk. The error message embeds the exact path passed on the command line.","triggerScenarios":"--config pointing to a typo'd filename, a relative path resolved from a different working directory, or a file not mounted into a container.","commonSituations":"Relative paths inside Docker/Kubernetes where CWD differs from the host, or CI where the config artifact was not downloaded.","solutions":["Verify the path exists: ls -l <path> from the same working directory used to launch","Use an absolute path for --config in containers/CI","Fix typos or mount/copy the file into the environment"],"exampleFix":"# before\npython -m sglang.launch_server --config confg.yaml\n# after\npython -m sglang.launch_server --config /etc/sglang/config.yaml","handlingStrategy":"validation","validationCode":"from pathlib import Path\np = Path(cfg_path)\nassert p.exists(), f\"missing config: {p.resolve()}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use absolute paths in containers/CI","Add a pre-launch existence check in deployment scripts"],"tags":["sglang","config","file-not-found","yaml"],"backgroundTag":"file-not-found","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}