{"record":{"id":"07a9f5b0bfb8f771","repo":"sgl-project/sglang","slug":"invalid-type-for-lora-paths-type-cfg-lora-path","errorCode":null,"errorMessage":"Invalid type for --lora-paths: {type(cfg.lora_paths)}. Expected a list or a dictionary.","messagePattern":"Invalid type for --lora-paths: (.+?)\\. Expected a list or a dictionary\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/server_args.py","lineNumber":10626,"sourceCode":"                    \"check_lora_server_args\", lora_paths=parsed_lora_paths\n                )\n            elif isinstance(cfg.lora_paths, dict):\n                self._late_resolution(\n                    \"check_lora_server_args\",\n                    lora_paths=[\n                        LoRARef(\n                            lora_id=LoRARef.deterministic_id(k, v),\n                            lora_name=k,\n                            lora_path=v,\n                            pinned=False,\n                        )\n                        for k, v in cfg.lora_paths.items()\n                    ],\n                )\n            elif cfg.lora_paths is None:\n                self._late_resolution(\"check_lora_server_args\", lora_paths=[])\n            else:\n                raise ValueError(\n                    f\"Invalid type for --lora-paths: {type(cfg.lora_paths)}. \"\n                    \"Expected a list or a dictionary.\"\n                )\n\n            # Normalize target modules to a set; keep {\"all\"} as a sentinel\n            # that gets resolved model-awarely in lora_manager.init_lora_shapes().\n            if cfg.lora_target_modules:\n                self._late_resolution(\n                    \"check_lora_server_args\",\n                    lora_target_modules=set(cfg.lora_target_modules),\n                )\n                if \"all\" in cfg.lora_target_modules:\n                    assert (\n                        len(cfg.lora_target_modules) == 1\n                    ), \"If 'all' is specified in --lora-target-modules, it should be the only module specified.\"\n\n            # Ensure sufficient information is provided for LoRA initialization.\n            assert cfg.lora_paths or (","sourceCodeStart":10608,"sourceCodeEnd":10644,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/server_args.py#L10608-L10644","documentation":"Raised when --lora-paths is not a list, dict, or None. The argument accepts a JSON list of paths/dicts, a JSON dict mapping name->path, or nothing at all; any other JSON type (string, number, bool) is rejected.","triggerScenarios":"Passing --lora-paths '/path/to/lora' (a bare string) or a number instead of a JSON list/dict.","commonSituations":"Forgetting JSON quoting so the value parses as a scalar string instead of a collection; shell quoting mistakes that collapse the list.","solutions":["Wrap the value as a JSON list: --lora-paths '[\"/path/to/lora\"]'","Or use a JSON dict: --lora-paths '{\"name\": \"/path\"}'","Or omit --lora-paths entirely if no adapters are needed"],"exampleFix":"# before\n--lora-paths /models/lora-a\n# after\n--lora-paths '[\"/models/lora-a\"]'","handlingStrategy":"type-guard","validationCode":"assert isinstance(lora_paths, (list, dict, type(None))), f'bad --lora-paths type: {type(lora_paths)}'","typeGuard":"def is_lora_paths(v) -> bool:\n    return v is None or isinstance(v, (list, dict))","tryCatchPattern":null,"preventionTips":["Pass a JSON-encoded list/dict; never a bare string","Add a config linter for CLI args in launch scripts"],"tags":["sglang","lora","cli-parsing","type-validation"],"backgroundTag":"invalid-argument-type","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}