{"record":{"id":"8c13bbdd00386907","repo":"sgl-project/sglang","slug":"config-file-not-found-args-config-8c13bb","errorCode":null,"errorMessage":"Config file not found: {args.config}","messagePattern":"Config file not found: (.+?)","errorType":"console","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/entrypoints/cli/serve.py","lineNumber":60,"sourceCode":"        run_sgl_diffusion_webui(server_args)\n\n\nclass ServeSubcommand(CLISubcommand):\n    \"\"\"The `serve` subcommand for the sglang-diffusion CLI\"\"\"\n\n    def __init__(self) -> None:\n        self.name = \"serve\"\n        super().__init__()\n\n    def cmd(\n        self, args: argparse.Namespace, unknown_args: list[str] | None = None\n    ) -> None:\n        execute_serve_cmd(args, unknown_args)\n\n    def validate(self, args: argparse.Namespace) -> None:\n        \"\"\"Validate the arguments for this command\"\"\"\n        if args.config and not os.path.exists(args.config):\n            raise ValueError(f\"Config file not found: {args.config}\")\n\n    def subparser_init(\n        self, subparsers: argparse._SubParsersAction\n    ) -> FlexibleArgumentParser:\n        serve_parser = subparsers.add_parser(\n            \"serve\",\n            help=\"Launch the server and start FastAPI listener.\",\n            usage=\"sglang serve --model-path MODEL_PATH_OR_ID [OPTIONS]\",\n        )\n\n        serve_parser = add_multimodal_gen_serve_args(serve_parser)\n\n        return cast(FlexibleArgumentParser, serve_parser)\n\n\ndef cmd_init() -> list[CLISubcommand]:\n    return [ServeSubcommand()]\n","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/entrypoints/cli/serve.py#L42-L78","documentation":"Raised by the `serve` CLI command's validate() when --config is given but the file does not exist (os.path.exists returns False). Identical guard to the generate command's, applied before the serve command starts a server.","triggerScenarios":"Running `sglang serve --config missing.yaml` where the config path is wrong, relative to the wrong cwd, or not mounted in the deployment environment.","commonSituations":"Deploying with docker/k8s where the config wasn't mounted at the expected path, relative paths breaking when launched from systemd or another directory, typos.","solutions":["Check the exact path with ls / abspath before launching","Use absolute paths in service/docker definitions","Ensure the config file is included in the container image or volume mount"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import os\nif args.config and not os.path.isfile(os.path.abspath(args.config)):\n    raise SystemExit(f\"config not found: {args.config}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Mount/copy the config into the container at a fixed absolute path","Add readiness checks in deploy scripts verifying the config exists","Use absolute paths in docker/systemd/k8s command lines"],"tags":["cli","config-file","serve","argument-validation"],"backgroundTag":"file-not-found","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}