{"record":{"id":"220d98868c063b0b","repo":"sgl-project/sglang","slug":"load-publish-endpoint-needs-an-active-kv-event","errorCode":null,"errorMessage":"--load-publish-endpoint needs an active --kv-events-config publisher; got publisher='null' or an empty endpoint.","messagePattern":"--load-publish-endpoint needs an active --kv-events-config publisher; got publisher='null' or an empty endpoint\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/server_args.py","lineNumber":10519,"sourceCode":"        server_cfg = resolving_view(self)\n\n        from sglang.srt.disaggregation.kv_events import (\n            KVEventsConfig,\n            resolve_load_pub_range,\n        )\n\n        if not self.kv_events_config:\n            raise ValueError(\n                \"--load-publish-endpoint requires --kv-events-config: routers\"\n                \" discover the load range through /server_info's kv_events\"\n                \" 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.","sourceCodeStart":10501,"sourceCodeEnd":10537,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/server_args.py#L10501-L10537","documentation":"Raised during ServerArgs validation when --load-publish-endpoint is set but the --kv-events-config does not describe an active publisher. SGLang requires a functioning KV events publisher (non-'null' publisher with a non-empty endpoint) before load-publish (KV transfer publication) can be enabled.","triggerScenarios":"Passing --load-publish-endpoint with a --kv-events-config that is omitted, uses publisher='null', or specifies an empty endpoint string.","commonSituations":"Enabling the KV-cache transfer/load-publish feature without first wiring up a KV events broker (Redis/Kafka/NATS); typos or copy-paste of a kv-events config that only sets the endpoint but leaves publisher as the default 'null'.","solutions":["Set --kv-events-config with an active publisher, e.g. publisher='redis' and a valid endpoint, then keep --load-publish-endpoint enabled","Verify KVEventsConfig.from_cli parses your config and that cfg.publisher != 'null' and cfg.endpoint is non-empty before starting the server","Drop --load-publish-endpoint if you do not need KV load publication"],"exampleFix":"# before\n--kv-events-config '{\"publisher\": \"null\", \"endpoint\": \"\"}' --load-publish-endpoint ...\n# after\n--kv-events-config '{\"publisher\": \"redis\", \"endpoint\": \"redis://localhost:6379\"}' --load-publish-endpoint ...","handlingStrategy":"validation","validationCode":"from sglang.srt.server_args import KVEventsConfig\ncfg = KVEventsConfig.from_cli(kv_events_config_str)\nassert cfg.publisher != 'null' and cfg.endpoint, 'need an active publisher before --load-publish-endpoint'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair --load-publish-endpoint with a fully specified --kv-events-config","Smoke-test the kv-events config string with from_cli before server launch"],"tags":["sglang","kv-events","config-validation","load-publish"],"backgroundTag":"missing-required-config","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}