{"record":{"id":"50557c75f13bbfb9","repo":"sgl-project/sglang","slug":"field-name-is-required","errorCode":null,"errorMessage":"{field_name} is required","messagePattern":"(.+?) is required","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/utils/common.py","lineNumber":125,"sourceCode":"\n    if len(set(parsed)) != len(parsed):\n        raise ValueError(f\"--gpu-ids contains duplicate GPU ids: {parsed}\")\n    return parsed\n\n\ndef parse_size(size: str) -> tuple[int | None, int | None]:\n    try:\n        parts = size.lower().replace(\" \", \"\").split(\"x\")\n        if len(parts) != 2:\n            raise ValueError\n        return int(parts[0]), int(parts[1])\n    except ValueError:\n        return None, None\n\n\ndef parse_tcp_host_port(value: str | None, field_name: str) -> tuple[str, int]:\n    if value is None or not str(value).strip():\n        raise ValueError(f\"{field_name} is required\")\n\n    addr = str(value).strip()\n    if addr.startswith(\"tcp://\"):\n        addr = addr[len(\"tcp://\") :]\n\n    try:\n        host, port_str = addr.rsplit(\":\", 1)\n    except ValueError as exc:\n        raise ValueError(\n            f\"{field_name} must be formatted as tcp://host:port or host:port\"\n        ) from exc\n\n    host = host.strip()\n    port_str = port_str.strip()\n    if not host or not port_str:\n        raise ValueError(f\"{field_name} must include both host and port: {value!r}\")\n\n    try:","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/utils/common.py#L107-L143","documentation":"Thrown by parse_tcp_host_port when the provided endpoint value is None or whitespace-only. The field named by field_name is mandatory for building a valid tcp://host:port endpoint.","triggerScenarios":"Calling parse_tcp_host_port(None, ...) or parse_tcp_host_port(\"  \", ...) — e.g. derive_pool_result_endpoint receiving an unset result endpoint field from the pool config.","commonSituations":"Missing required config field (endpoint not set in YAML/CLI), environment variable for the ZMQ endpoint unset, or default config changed between versions making a previously-optional field required.","solutions":["Set the required endpoint field (host:port or tcp://host:port) in the config object before deriving endpoints","Check the env var / CLI flag that feeds this field is actually set and non-empty","Print/dump the config right before the call to confirm which field_name is missing"],"exampleFix":"# before\npool.result_endpoint = None\n# after\npool.result_endpoint = \"127.0.0.1:5555\"","handlingStrategy":"validation","validationCode":"if not endpoint or not str(endpoint).strip():\n    raise SystemExit(\"result endpoint is required (host:port)\")","typeGuard":"def is_set_endpoint(v) -> bool:\n    return v is not None and bool(str(v).strip())","tryCatchPattern":"try:\n    host, port = parse_tcp_host_port(cfg.endpoint, \"endpoint\")\nexcept ValueError as e:\n    if \"is required\" in str(e):\n        cfg.endpoint = pick_free_port_endpoint()\n    else:\n        raise","preventionTips":["Fail fast at config load on missing endpoint fields","Log the resolved config before deriving endpoints"],"tags":["zmq","endpoint","config","validation"],"backgroundTag":"missing-required-config","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}