{"record":{"id":"a634c2b65cc584bc","repo":"sgl-project/sglang","slug":"unknown-event-publisher-kind","errorCode":null,"errorMessage":"Unknown event publisher '{kind}'","messagePattern":"Unknown event publisher '(.+?)'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/disaggregation/kv_events.py","lineNumber":658,"sourceCode":"    @classmethod\n    def register_publisher(cls, name: str, ctor: Callable[..., EventPublisher]) -> None:\n        if name in cls._registry:\n            raise KeyError(f\"publisher '{name}' already registered\")\n        cls._registry[name] = ctor\n\n    @classmethod\n    def create(cls, config: Optional[str], attn_dp_rank: int = 0) -> EventPublisher:\n        \"\"\"Create publisher from a config mapping.\"\"\"\n        if not config:\n            return NullEventPublisher()\n        config = KVEventsConfig.from_cli(config)\n        config_dict = config.model_dump()\n\n        kind = config_dict.pop(\"publisher\", \"null\")\n        try:\n            constructor = cls._registry[kind]\n        except KeyError as exc:\n            raise ValueError(f\"Unknown event publisher '{kind}'\") from exc\n        return constructor(attn_dp_rank=attn_dp_rank, **config_dict)\n","sourceCodeStart":640,"sourceCodeEnd":660,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/disaggregation/kv_events.py#L640-L660","documentation":"KV event publishers self-register in a class registry keyed by the 'publisher' config string; create() looks up that key and raises ValueError for an unregistered kind.","triggerScenarios":"Passing KVEventsConfig(publisher=\"...\") with a name that has no registered constructor — typo ('kaffka'), a publisher whose registration import failed, or a new name not in the build.","commonSituations":"Typos in --kv-events-config, using a publisher available only in a newer/older sglang version, or optional dependency (kafka) missing so the class never registered.","solutions":["Check the spelling against supported publishers (e.g. 'null', 'kafka', 'radix', 'nixl')","Install optional deps needed for the publisher (e.g. kafka-python)","Verify the publisher class is imported/registered in your build"],"exampleFix":"// before\n{\"publisher\": \"kaffka\", ...}\n// after\n{\"publisher\": \"kafka\", ...}","handlingStrategy":"validation","validationCode":"from sglang.srt.disaggregation.kv_events import KVEventsPublisherFactory  # registry holder\nkind = cfg.publisher\nassert kind in KVEventsPublisherFactory._registry, f\"unknown publisher {kind}; known={list(KVEventsPublisherFactory._registry)}\"","typeGuard":"def is_known_publisher(kind: str) -> bool: return kind in KVEventsPublisherFactory._registry","tryCatchPattern":"catch ValueError from create() at startup; print registered kinds and exit with config error","preventionTips":["Add a config lint step listing valid publisher names","Install optional extras (kafka) before selecting that publisher"],"tags":["kv-events","config","registry"],"backgroundTag":"unknown-provider-name","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}