{"record":{"id":"0a10e99254a031e1","repo":"sgl-project/sglang","slug":"multiple-distributions-register-serve-backend-nam","errorCode":null,"errorMessage":"Multiple distributions register serve backend {name!r}: {providers}. Uninstall one provider or choose another backend name.","messagePattern":"Multiple distributions register serve backend (.+?): (.+?)\\. Uninstall one provider or choose another backend name\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/sglang/cli/serve_backends.py","lineNumber":137,"sourceCode":"    def get(self, name: str) -> RegisteredServeBackend:\n        \"\"\"Return one backend, importing only the explicitly requested plugin.\"\"\"\n\n        if name in self._loaded:\n            return self._loaded[name]\n\n        candidates = self._entry_points.get(name, [])\n        if not candidates:\n            available = \", \".join((\"auto\", *self.available_names))\n            raise ValueError(\n                f\"Unknown serve backend {name!r}. Available values: {available}.\"\n            )\n        if len(candidates) > 1:\n            providers = \", \".join(\n                sorted(\n                    self._entry_point_provider(candidate) for candidate in candidates\n                )\n            )\n            raise RuntimeError(\n                f\"Multiple distributions register serve backend {name!r}: \"\n                f\"{providers}. Uninstall one provider or choose another backend name.\"\n            )\n\n        entry_point = candidates[0]\n        try:\n            factory = entry_point.load()\n            if not callable(factory):\n                raise TypeError(\"the entry point must resolve to a callable factory\")\n            backend = factory()\n        except Exception as exc:\n            raise RuntimeError(\n                f\"Failed to load serve backend {name!r} from \"\n                f\"{self._entry_point_provider(entry_point)}: {exc}\"\n            ) from exc\n\n        if not isinstance(backend, ServeBackend):\n            raise TypeError(","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/cli/serve_backends.py#L119-L155","documentation":"Raised when more than one installed distribution registers a serve backend under the same name in the 'sglang.serve_backends' entry-point group. SGLang cannot disambiguate which implementation to load, so it refuses with a RuntimeError naming the conflicting provider distributions.","triggerScenarios":"Two distributions (e.g. an upstream plugin and a local fork, or a renamed package where both old and new are installed) each declare the same backend name in the sglang.serve_backends entry-point group; calling registry.get(name) for that name.","commonSituations":"Developing a fork of a backend plugin alongside the published one; pip install -e . of a local copy while the PyPI version is still installed; package renames leaving duplicate metadata behind.","solutions":["pip uninstall one of the conflicting distributions listed in the error message, then retry.","Use a different backend name for the local fork (rename its entry point) so both can coexist.","Verify with `importlib.metadata.entry_points(group='sglang.serve_backends')` that only one candidate remains per name."],"exampleFix":"# before: both sglang-plugin-x and sglang-plugin-x-fork register backend \"x\"\n# after\npip uninstall sglang-plugin-x-fork  # or rename its entry point to \"x-dev\"","handlingStrategy":"validation","validationCode":"from importlib.metadata import entry_points\neps = entry_points(group=\"sglang.serve_backends\")\nnames = {}\nfor ep in eps:\n    names.setdefault(ep.name, []).append(ep)\namb = {n: ps for n, ps in names.items() if len(ps) > 1}\nassert not amb, f\"ambiguous backends: {amb}\"","typeGuard":"def is_unambiguous(name: str) -> bool:\n    return len(list(entry_points(group=\"sglang.serve_backends\", name=name))) <= 1","tryCatchPattern":"try:\n    backend = registry.get(name)\nexcept RuntimeError as e:\n    if \"Multiple distributions\" in str(e):\n        # print providers, ask user to uninstall one\n        ...","preventionTips":["In CI, assert exactly one entry point per backend name after installing dependencies.","Use a dedicated venv per backend-fork to avoid co-installing duplicate providers.","Name forked backend entry points distinctly (e.g. x-dev) instead of shadowing."],"tags":["sglang","cli","entry-points","duplicate-registration","plugin-conflict"],"backgroundTag":"duplicate-plugin-registration","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}