{"record":{"id":"fe820e6c47a12b4e","repo":"sgl-project/sglang","slug":"config-file-not-found-args-config","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/generate.py","lineNumber":237,"sourceCode":"        \"\"\"Get names of arguments for DiffGenerator initialization\"\"\"\n        return [\"num_gpus\", \"tp_size\", \"sp_size\", \"model_path\"]\n\n    def _get_generation_arg_names(self) -> list[str]:\n        \"\"\"Get names of arguments for generate_video method\"\"\"\n        return [field.name for field in dataclasses.fields(SamplingParams)]\n\n    def cmd(\n        self, args: argparse.Namespace, unknown_args: list[str] | None = None\n    ) -> None:\n        generate_cmd(args, unknown_args)\n\n    def validate(self, args: argparse.Namespace) -> None:\n        \"\"\"Validate the arguments for this command\"\"\"\n        if args.num_gpus is not None and args.num_gpus <= 0:\n            raise ValueError(\"Number of gpus must be positive\")\n\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        generate_parser = subparsers.add_parser(\n            \"generate\",\n            help=\"Run inference on a model\",\n            usage=\"sglang generate (--model-path MODEL_PATH_OR_ID --prompt PROMPT) | --config CONFIG_FILE [OPTIONS]\",\n        )\n\n        generate_parser = add_multimodal_gen_generate_args(generate_parser)\n\n        return cast(FlexibleArgumentParser, generate_parser)\n","sourceCodeStart":219,"sourceCodeEnd":251,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/entrypoints/cli/generate.py#L219-L251","documentation":"Raised by the `generate` CLI command's validate() when --config is given but the file does not exist at that path (os.path.exists fails). The config file is required to parse generation settings before launching.","triggerScenarios":"Running `sglang generate --config /path/that/does/not/exist.yaml` — wrong path, relative path resolved from a different cwd, or the file was never created.","commonSituations":"Relative paths run from a different working directory, typos in the path, files not synced into a container, '~' not expanded by the shell inside quotes.","solutions":["Verify the path exists: ls the exact path used in the command","Use an absolute path to avoid cwd-dependent resolution","If inside Docker/CI, confirm the config is copied/mounted into the container"],"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":["Use absolute config paths in scripts and service definitions","Check file presence in deployment pipelines before invoking the CLI","Expand ~ and verify cwd when using relative paths"],"tags":["cli","config-file","argument-validation"],"backgroundTag":"file-not-found","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}