{"record":{"id":"5d843191027452c3","repo":"sgl-project/sglang","slug":"extra-config-r-must-be-a-boolean-like-value-t","errorCode":null,"errorMessage":"extra_config[{!r}] must be a boolean-like value (true/false, 1/0, yes/no, on/off), got {!r}","messagePattern":"extra_config\\[(.+?)\\] must be a boolean-like value \\(true/false, 1/0, yes/no, on/off\\), got (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/mem_cache/storage/umbp/umbp_store.py","lineNumber":79,"sourceCode":"\n_TRUE_STRINGS = frozenset({\"1\", \"true\", \"yes\", \"on\"})\n_FALSE_STRINGS = frozenset({\"0\", \"false\", \"no\", \"off\"})\n\n\ndef _strict_bool(value: Any, key: str) -> bool:\n    \"\"\"Strict boolean parse; raises rather than silently inverting (bool(\"false\") is True).\"\"\"\n    if isinstance(value, bool):\n        return value\n    if isinstance(value, int):\n        if value in (0, 1):\n            return bool(value)\n    elif isinstance(value, str):\n        norm = value.strip().lower()\n        if norm in _TRUE_STRINGS:\n            return True\n        if norm in _FALSE_STRINGS:\n            return False\n    raise ValueError(\n        f\"extra_config[{key!r}] must be a boolean-like value \"\n        f\"(true/false, 1/0, yes/no, on/off), got {value!r}\"\n    )\n\n\ndef _cast_like(current: Any, value: Any, key: str) -> Any:\n    \"\"\"Cast ``value`` to match the type of an existing config attribute.\"\"\"\n    if isinstance(current, bool):\n        return _strict_bool(value, key)\n    if isinstance(current, int):\n        return int(value)\n    if isinstance(current, float):\n        return float(value)\n    return str(value)\n\n\ndef _default_node_address() -> str:\n    try:","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/mem_cache/storage/umbp/umbp_store.py#L61-L97","documentation":"Strict boolean coercion for an extra_config key failed: the value is neither bool/int nor one of the accepted strings ('true'/'false','1'/'0','yes'/'no','on'/'off' after strip/lower).","triggerScenarios":"Passing extra_config={'prefault': 'maybe'} or another non-boolean-like value to the UMBP store constructor; _cast_like routes it into _strict_bool which raises ValueError naming the key.","commonSituations":"Typos in server CLI --storage-extra-config JSON, quoting issues making the value a nested list/dict, or copy-pasted config from a different schema.","solutions":["Fix the value to a boolean-like literal (true/false, 1/0, yes/no, on/off)","Validate the extra_config dict against the documented schema before constructing the store"],"exampleFix":"# before\nextra = {'prefault': 'enabled'}\n# after\nextra = {'prefault': True}","handlingStrategy":"validation","validationCode":"_BOOLS = {'true':True,'false':False,'1':True,'0':False,'yes':True,'no':False,'on':True,'off':False}\ndef valid_bool(v):\n    return isinstance(v, bool) or (isinstance(v, int) and v in (0,1)) or (isinstance(v, str) and v.strip().lower() in _BOOLS)\nassert all(valid_bool(v) for k, v in extra.items() if k in BOOL_KEYS)","typeGuard":"def is_boolean_like(v) -> bool:\n    _B={'true','false','1','0','yes','no','on','off'}\n    return isinstance(v,bool) or (isinstance(v,int) and v in (0,1)) or (isinstance(v,str) and v.strip().lower() in _B)","tryCatchPattern":null,"preventionTips":["Use real JSON booleans in extra_config, not strings","Validate extra_config with a schema before launching the server"],"tags":["umbp","config-validation","boolean"],"backgroundTag":"config-validation-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}