sgl-project/sglang · error · AttributeError

config namespace {path!r} has no leaf/subgroup {name!r}

Error message

config namespace {path!r} has no leaf/subgroup {name!r}

What it means

Error "config namespace {path!r} has no leaf/subgroup {name!r}" thrown in sgl-project/sglang.

Source

Thrown at python/sglang/srt/runtime_context.py:638

    """

    def __init__(self, path: str):
        object.__setattr__(self, "_path", path)
        object.__setattr__(self, "_fields", {})  # {leaf: value}
        object.__setattr__(self, "_subs", {})  # {subname: _ConfigBag}

    def __getattr__(self, name: str) -> Any:
        # Fallback only: real leaves/sub-bags resolve via __dict__ before this
        # runs. Uses object.__getattribute__ (not self._fields) to stay safe if
        # invoked before __init__ populates the bookkeeping dicts.
        fields = object.__getattribute__(self, "_fields")
        if name in fields:
            return fields[name]
        subs = object.__getattribute__(self, "_subs")
        if name in subs:
            return subs[name]
        path = object.__getattribute__(self, "_path")
        raise AttributeError(f"config namespace {path!r} has no leaf/subgroup {name!r}")

    def __setattr__(self, name: str, value: Any) -> None:
        raise AttributeError(
            f"config namespace {self._path!r} is read-only; write via "
            "get_context().override(source, ...) or the scoped .override(**kw)"
        )

    def _set(self, name: str, value: Any) -> None:
        """Internal write (publish + override) that bypasses the read-only guard.
        Updates both the bookkeeping map and the real attribute (traceable read)."""
        object.__getattribute__(self, "_fields")[name] = value
        object.__setattr__(self, name, value)

    def _set_sub(self, name: str, sub: _ConfigBag) -> None:
        """Register a nested bag as both a bookkeeping entry and a real
        attribute (so ``bag.sub`` is a plain, traceable attribute load)."""
        object.__getattribute__(self, "_subs")[name] = sub
        object.__setattr__(self, name, sub)

View on GitHub (pinned to 0132848349)

When it happens

Trigger: Thrown at python/sglang/srt/runtime_context.py:638 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/75ed92d39243eb71. Report an issue: GitHub.