sgl-project/sglang · error · NotImplementedError
PR #{pr_num} revert is not registered; available: {sorted(_P
Error message
PR #{pr_num} revert is not registered; available: {sorted(_PR_FIX_REVERT_YAML.keys())} What it means
Raised by _revert_pr_fix when SGLANG_DEBUG_REVERT_PR names a PR number that has no entry in the _PR_FIX_REVERT_YAML registry. The revert mechanism is a curated table of PR numbers mapped to patch YAML files; only registered PRs can be reverted. The error message lists the currently available PR numbers to guide the user.
Source
Thrown at python/sglang/srt/debug_utils/pr_fix_toggle.py:125
_PR_FIX_REVERT_YAML: Dict[int, str] = {
25015: _PR_REVERT_YAML_25015,
26329: _PR_REVERT_YAML_26329,
27338: _PR_REVERT_YAML_27338,
27360: _PR_REVERT_YAML_27360,
26972: _PR_REVERT_YAML_26972,
27460: _PR_REVERT_YAML_27460,
}
def maybe_revert_pr_fix() -> None:
if pr_num := envs.SGLANG_DEBUG_REVERT_PR.get():
_revert_pr_fix(pr_num)
def _revert_pr_fix(pr_num: int) -> None:
if pr_num not in _PR_FIX_REVERT_YAML:
raise NotImplementedError(
f"PR #{pr_num} revert is not registered; "
f"available: {sorted(_PR_FIX_REVERT_YAML.keys())}"
)
apply_patches_from_config(_PR_FIX_REVERT_YAML[pr_num])
View on GitHub (pinned to 0132848349)
Solutions
- Pick a PR number from the list printed in the error message (sorted keys of _PR_FIX_REVERT_YAML)
- Check the value of SGLANG_DEBUG_REVERT_PR for typos or stray characters
- If you need an unlisted PR reverted, add a corresponding YAML entry to _PR_FIX_REVERT_YAML or unset the env var
Example fix
# before export SGLANG_DEBUG_REVERT_PR=12345 # not registered # after # choose from the available list in the error message, e.g. export SGLANG_DEBUG_REVERT_PR=4200
Defensive patterns
Strategy: validation
Validate before calling
import os
from sglang.srt.debug_utils.pr_fix_toggle import _PR_FIX_REVERT_YAML
pr = os.environ.get('SGLANG_DEBUG_REVERT_PR')
if pr is not None and int(pr) not in _PR_FIX_REVERT_YAML:
raise ConfigError(f'{pr} not in {sorted(_PR_FIX_REVERT_YAML)}') Try / catch
try:
maybe_revert_pr_fix()
except NotImplementedError as e:
log.warning('revert not registered: %s', e)
os.environ.pop('SGLANG_DEBUG_REVERT_PR', None) Prevention
- Cross-check the env var value against the registry keys at startup
- Treat the error message's available list as the source of truth
- Unset the env var in production to avoid accidental reverts
When it happens
Trigger: Setting SGLANG_DEBUG_REVERT_PR=<n> where <n> is not a key in _PR_FIX_REVERT_YAML, then triggering maybe_revert_pr_fix() (usually at debug-session startup).
Common situations: Typos in the env var value; trying to revert a PR that predates the revert-registry feature or whose patch file was never added; version skew where the registry keys changed between sglang versions.
Related errors
- KernelSpec.target must be 'module:attr', got {self.target!r}
- Invalid ltx2_two_stage_device_mode={mode!r}. Expected one of
- --enable-hisparse is not supported with the unified-KV path
- Kimi-K3 DCP + DSPARK currently requires SGLANG_RAGGED_VERIFY
- RPC error on {self._debug_name}: {response['error']}
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/5e645cbdd2a55133.
Report an issue: GitHub.