{"record":{"id":"a811916b34886110","repo":"sgl-project/sglang","slug":"reason","errorCode":null,"errorMessage":"{reason}","messagePattern":"\\{reason\\}","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/server_args.py","lineNumber":10530,"sourceCode":"                \" block, absent without a publisher.\"\n            )\n        try:\n            cfg = KVEventsConfig.from_cli(self.kv_events_config)\n        except Exception as e:\n            raise ValueError(f\"--kv-events-config is not parseable: {e}\")\n        if cfg.publisher == \"null\" or not cfg.endpoint:\n            raise ValueError(\n                \"--load-publish-endpoint needs an active --kv-events-config\"\n                \" publisher; got publisher='null' or an empty endpoint.\"\n            )\n        _, reason = resolve_load_pub_range(\n            kv_endpoint=cfg.endpoint,\n            replay_endpoint=cfg.replay_endpoint,\n            dp_size=server_cfg.dp_size,\n            load_publish_endpoint=mode,\n        )\n        if reason:\n            raise ValueError(reason)\n\n    def check_lora_server_args(self):\n        cfg = resolving_view(self)\n\n        assert cfg.max_loras_per_batch > 0, \"max_loras_per_batch must be positive\"\n\n        # Enable LoRA if any LoRA paths are provided for backward compatibility.\n        if cfg.lora_paths:\n            if cfg.enable_lora is None:\n                self._late_resolution(\"check_lora_server_args\", enable_lora=True)\n                logger.warning(\n                    \"--enable-lora is set to True because --lora-paths is provided.\"\n                )\n            elif cfg.enable_lora is False:\n                logger.warning(\n                    \"--enable-lora is set to False, any provided lora_paths will be ignored.\"\n                )\n","sourceCodeStart":10512,"sourceCodeEnd":10548,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/server_args.py#L10512-L10548","documentation":"Raised when resolve_load_pub_range finds an inconsistency between the KV events endpoint, replay endpoint, dp_size, and the load-publish mode. The returned reason string explains the specific mismatch, e.g. incompatible replay endpoint or DP size for the chosen mode.","triggerScenarios":"Passing --load-publish-endpoint with a mode whose expected endpoint/replay-endpoint layout or dp_size does not match the values parsed from --kv-events-config.","commonSituations":"Running data-parallel setups where the load publish mode implies per-DP endpoints but the supplied endpoints don't conform; changing dp_size without regenerating the KV events config.","solutions":["Read the {reason} text — it names the exact mismatch to fix","Ensure the KV endpoint and replay_endpoint in --kv-events-config match the layout required by the chosen load-publish mode for your dp_size","Re-run with a consistent --load-publish-endpoint mode or adjust dp_size"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from sglang.srt.server_args import resolve_load_pub_range\n_, reason = resolve_load_pub_range(kv_endpoint=cfg.endpoint, replay_endpoint=cfg.replay_endpoint, dp_size=dp_size, load_publish_endpoint=mode)\nif reason:\n    raise SystemExit(reason)","typeGuard":null,"tryCatchPattern":"catch ValueError and surface its reason verbatim in launch tooling","preventionTips":["Keep dp_size and endpoint layout in sync when changing load-publish modes","Run a preflight resolve_load_pub_range check in deploy scripts"],"tags":["sglang","kv-events","endpoint-mismatch","dp-size"],"backgroundTag":"config-value-mismatch","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}