{"record":{"id":"90d0db550b5f24e4","repo":"sgl-project/sglang","slug":"scheduler-rpc-timeout-must-be-none-or-an-integer-b","errorCode":null,"errorMessage":"scheduler_rpc_timeout must be None or an integer between 1 and {MAX_SCHEDULER_RPC_TIMEOUT_S} seconds","messagePattern":"scheduler_rpc_timeout must be None or an integer between 1 and (.+?) seconds","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/server_args/server_args.py","lineNumber":599,"sourceCode":"        if self.lora_alpha is not None and self.lora_alpha <= 0:\n            raise ValueError(\"lora_alpha must be a positive integer\")\n        if not current_platform.is_cpu():\n            self._validate_parallelism()\n        self._validate_cfg_parallel()\n        self._validate_batching()\n        self._validate_breakable_cuda_graph()\n        self.pipeline_config.validate_server_args(self)\n\n    def _validate_scheduler_rpc_timeout(self) -> None:\n        timeout = self.scheduler_rpc_timeout\n        if timeout is None:\n            return\n        if (\n            not isinstance(timeout, int)\n            or isinstance(timeout, bool)\n            or not 0 < timeout <= MAX_SCHEDULER_RPC_TIMEOUT_S\n        ):\n            raise ValueError(\n                \"scheduler_rpc_timeout must be None or an integer between \"\n                f\"1 and {MAX_SCHEDULER_RPC_TIMEOUT_S} seconds\"\n            )\n\n    def resolved_bcg_text_buckets(self) -> tuple[int, ...]:\n        \"\"\"Sorted, de-duplicated, positive BCG text buckets.\n\n        Falls back to :data:`DEFAULT_BCG_TEXT_BUCKETS` when ``--bcg-text-buckets``\n        is unset, so both prompt padding and warmup capture share one source of\n        truth instead of the legacy ``SGLANG_BCG_TEXT_BUCKETS`` env var.\n        \"\"\"\n        raw = self.bcg_text_buckets\n        if not raw:\n            return DEFAULT_BCG_TEXT_BUCKETS\n        buckets = sorted({int(b) for b in raw if int(b) > 0})\n        return tuple(buckets) or DEFAULT_BCG_TEXT_BUCKETS\n\n    def _validate_breakable_cuda_graph(self):","sourceCodeStart":581,"sourceCodeEnd":617,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/server_args/server_args.py#L581-L617","documentation":"_validate_scheduler_rpc_timeout requires scheduler_rpc_timeout to be None or a Python int in the range 1..MAX_SCHEDULER_RPC_TIMEOUT_S (bools are explicitly rejected because bool is a subclass of int).","triggerScenarios":"Passing scheduler_rpc_timeout=0, a negative number, a float like 2.5, a string like '30', a value above MAX_SCHEDULER_RPC_TIMEOUT_S, or True/False.","commonSituations":"Parsing the timeout from an env var or YAML as a string/float; setting a very large timeout for slow distributed setups; accidentally passing a flag boolean.","solutions":["Pass None for the default or an int between 1 and MAX_SCHEDULER_RPC_TIMEOUT_S","Coerce types explicitly: int(value) when loading from env/config","If you need a longer timeout than the max, reduce scheduler load (smaller batch, fewer ranks) instead of exceeding the cap"],"exampleFix":"# before\nServerArgs(..., scheduler_rpc_timeout=\"30\")\n# after\nServerArgs(..., scheduler_rpc_timeout=30)","handlingStrategy":"validation","validationCode":"t = cfg.get('scheduler_rpc_timeout')\nassert t is None or (isinstance(t, int) and not isinstance(t, bool) and 1 <= t <= MAX_SCHEDULER_RPC_TIMEOUT_S), 'bad scheduler_rpc_timeout'","typeGuard":"def valid_rpc_timeout(v) -> bool:\n    return v is None or (isinstance(v, int) and not isinstance(v, bool) and 1 <= v <= MAX_SCHEDULER_RPC_TIMEOUT_S)","tryCatchPattern":null,"preventionTips":["Always int()-cast timeouts loaded from env vars or YAML","Document the MAX_SCHEDULER_RPC_TIMEOUT_S cap in deployment runbooks"],"tags":["timeout","rpc","scheduler","config-validation"],"backgroundTag":"config-out-of-range","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}