{"record":{"id":"c505e792ff8e1a98","repo":"sgl-project/sglang","slug":"received-ipv6-address-format-expected-after","errorCode":null,"errorMessage":"received IPv6 address format: expected ':' after ']'","messagePattern":"received IPv6 address format: expected ':' after '\\]'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/utils/common.py","lineNumber":177,"sourceCode":"def configure_ipv6(dist_init_addr):\n    addr = dist_init_addr\n    end = addr.find(\"]\")\n    if end == -1:\n        raise ValueError(\"invalid IPv6 address format: missing ']'\")\n\n    host = addr[: end + 1]\n\n    # this only validates the address without brackets: we still need the below checks.\n    # if it's invalid, immediately raise an error so we know it's not formatting issues.\n    if not is_valid_ipv6_address(host[1:end]):\n        raise ValueError(f\"invalid IPv6 address: {host}\")\n\n    port_str = None\n    if len(addr) > end + 1:\n        if addr[end + 1] == \":\":\n            port_str = addr[end + 2 :]\n        else:\n            raise ValueError(\"received IPv6 address format: expected ':' after ']'\")\n\n    if not port_str:\n        raise ValueError(\n            \"a port must be specified in IPv6 address (format: [ipv6]:port)\"\n        )\n\n    try:\n        port = int(port_str)\n    except ValueError:\n        raise ValueError(f\"invalid port in IPv6 address: '{port_str}'\")\n    return port, host\n\n\ndef is_port_available(port):\n    \"\"\"Return whether a port is available.\"\"\"\n    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:\n        try:\n            s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/utils/common.py#L159-L195","documentation":"Thrown by configure_ipv6 when text follows the closing ']' but the next character is not ':', so no port separator exists. The expected format is [ipv6]:port.","triggerScenarios":"Passing \"[fe80::1]/29500\" or \"[fe80::1]29500\" — anything after ']' that doesn't start with ':'.","commonSituations":"Typos, or addresses copied with a slash/extra characters after the bracket; URL-style formatting applied where host:port is expected.","solutions":["Put the port directly after a colon: \"[fe80::1]:29500\"","Remove any path, slash, or stray characters after the bracket"],"exampleFix":"# before\naddr = \"[fe80::1]/29500\"\n# after\naddr = \"[fe80::1]:29500\"","handlingStrategy":"validation","validationCode":"end = addr.index(\"]\")\nassert len(addr) == end + 1 or addr[end + 1] == \":\", \"expected ':' after ']'\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build IPv6 endpoints only via f\"[{host}]:{port}\" formatting"],"tags":["ipv6","distributed","network","validation"],"backgroundTag":"invalid-ipv6-address","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}