{"record":{"id":"e3540fa65060fcb5","repo":"sgl-project/sglang","slug":"subgroup-seg-r-missing-under-path-r","errorCode":null,"errorMessage":"subgroup {seg!r} missing under {path!r}","messagePattern":"subgroup (.+?) missing under (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/runtime_context.py","lineNumber":944,"sourceCode":"\n        Callers that hold a field name rather than a namespace (a readback\n        endpoint, a control-plane handler) would otherwise have to know which\n        bag it lives in.\n        \"\"\"\n        bags = self._config_bags\n        if bags is None:\n            raise ValueError(\"config not published; cannot read a config leaf\")\n        from sglang.srt.arg_groups.arg_utils import namespace_of\n\n        path = namespace_of(type(self._server_args)).get(name)\n        if path is None:\n            raise ValueError(f\"{name!r} is not a config leaf (no NS namespace)\")\n        parts = path.split(\".\")\n        bag = self.config_bag(parts[0])\n        for seg in parts[1:]:\n            bag = object.__getattribute__(bag, \"_subs\").get(seg)\n            if bag is None:\n                raise ValueError(f\"subgroup {seg!r} missing under {path!r}\")\n        return getattr(bag, name)\n\n    def overrides_log(self) -> list:\n        \"\"\"Provenance of post-publish ``override`` calls: ``[(source, {field: value})]``.\n\n        Returns deep-ish copies (source, dict(fields)) so callers inspecting the\n        log cannot mutate the recorded provenance in place.\"\"\"\n        return [(source, dict(fields)) for source, fields in self._overrides_log]\n\n    def resolved_server_args_dict(self, base: dict | None = None) -> dict:\n        \"\"\"Serialize the *resolved* config: the pristine ``server_args`` fields\n        with every post-publish ``override`` overlaid.\n\n        ``get_internal_state`` reports this, and ``/server_info`` carries it in\n        the ``internal_states`` block, so scheduler-side runtime changes show up\n        in a readback: HiCache attach/detach, the generated forward-pass-metrics\n        endpoint, tunables set via ``/set_internal_state``.\n","sourceCodeStart":926,"sourceCodeEnd":962,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/runtime_context.py#L926-L962","documentation":"After resolving the field's dotted namespace path, config_leaf walks the sub-bags via bag._subs. If an intermediate subgroup named in the path is missing from the published bag tree, the traversal hits None and this error fires. It indicates the published projection is inconsistent with the namespace map — usually a registration or role-pruning bug, not a caller typo.","triggerScenarios":"A field whose namespace_of path is 'a.b.field' where the published bag for 'a' lacks sub-bag 'b'; publishing under a role whose ROLE_NAMESPACE_SETS entry prunes that subgroup out of the bag tree; adding a new namespace subgroup without registering it in the bag projection.","commonSituations":"Adding a new config subgroup in development and forgetting to register it where bags are built; running with SGLANG_ROLE_NAMESPACES=enforce and a role namespace set that excludes the subgroup you then try to read; desync between the namespace map and bag construction after a refactor.","solutions":["Check the role's ROLE_NAMESPACE_SETS entry includes the namespace subgroup you are reading (or is None for the full tree)","Verify the subgroup is registered in the bag-projection code path that builds _subs","If the namespace map and bag construction are out of sync after a refactor, fix/report the projection upstream"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    value = ctx.config_leaf(name)\nexcept ValueError as e:\n    if \"missing under\" in str(e):\n        raise RuntimeError(f\"config bag tree inconsistent for {name}: {e}\") from e\n    raise","preventionTips":["When adding new namespace subgroups, add a test that reads one leaf from every subgroup after publish","Ensure ROLE_NAMESPACE_SETS entries cover the subgroups each role will read"],"tags":["config","namespace","projection-mismatch","sglang"],"backgroundTag":"missing-config-namespace","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}