{"record":{"id":"54085dea705b7ccf","repo":"apache/incubator-seata","slug":"invalid-endpoint-format-address-port-mu","errorCode":null,"errorMessage":"\"Invalid endpoint format: \" + address + \". Port must be between 1 and 65535.\"","messagePattern":"\"Invalid endpoint format: \" \\+ address \\+ \"\\. Port must be between 1 and 65535\\.\"","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"common/src/main/java/org/apache/seata/common/util/NetUtil.java","lineNumber":153,"sourceCode":"        }\n        if (address.charAt(0) == '[') {\n            address = removeBrackets(address);\n        }\n        int i = address.lastIndexOf(Constants.IP_PORT_SPLIT_CHAR);\n        if (i > -1) {\n            String hostAddress = address.substring(0, i);\n            if (hostAddress.contains(\"%\")) {\n                hostAddress = hostAddress.substring(0, hostAddress.indexOf(\"%\"));\n            }\n            String portStr = address.substring(i + 1);\n            if (StringUtils.isBlank(hostAddress) || StringUtils.isBlank(portStr)) {\n                throw new IllegalArgumentException(\n                        \"Invalid endpoint format: \" + address + \". Endpoint should be in the format ip:port.\");\n            }\n            try {\n                int port = Integer.parseInt(portStr);\n                if (port < 1 || port > 65535) {\n                    throw new IllegalArgumentException(\n                            \"Invalid endpoint format: \" + address + \". Port must be between 1 and 65535.\");\n                }\n            } catch (NumberFormatException e) {\n                throw new IllegalArgumentException(\n                        \"Invalid endpoint format: \" + address + \". Port must be a numeric value.\", e);\n            }\n\n            return new String[] {hostAddress, portStr};\n        } else {\n            throw new IllegalArgumentException(\n                    \"Invalid endpoint format: \" + address + \". Endpoint should be in the format ip:port.\");\n        }\n    }\n\n    /**\n     * To long long.\n     *\n     * @param address the address","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/apache/incubator-seata/blob/e01f97c6db397165050caa6764020410c2c8199a/common/src/main/java/org/apache/seata/common/util/NetUtil.java#L135-L171","documentation":"NetUtil.splitIPPortStr validates the port segment after parsing it as an integer; a port must be between 1 and 65535. This IllegalArgumentException is thrown when the numeric port is out of range — 0, negative, or above 65535 — so the address can never produce a usable socket.","triggerScenarios":"Calling splitIPPortStr/toInetSocketAddress with addresses like \"127.0.0.1:0\", \"host:70000\", or \"host:-1\". The port parses as a number but fails the 1..65535 bounds check.","commonSituations":"Misconfigured port in seata server/grouplist properties (e.g. port set to 0 meaning 'unset' by a deployment tool), copy-paste errors appending an extra digit, or environment-variable port defaults of 0.","solutions":["Set the port to a valid TCP port in [1, 65535] (Seata default is 8091 for the server, 8080/8091 common for console)","Check the specific property (server.port, grouplist address) for 0 or 5-digit typos","Validate ports at deployment time (e.g. JSON schema or Helm values check)"],"exampleFix":"# before\nservice.default.grouplist = 127.0.0.1:0\n\n# after\nservice.default.grouplist = 127.0.0.1:8091","handlingStrategy":"validation","validationCode":"String[] p = address.split(\":\");\nint port = Integer.parseInt(p[p.length - 1]);\nif (port < 1 || port > 65535) throw new IllegalArgumentException(\"port out of range: \" + address);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat a configured port of 0 as 'unset' and refuse to start","Lint deployment values for port ranges","Prefer named constants for well-known Seata ports"],"tags":["network","port","address-parsing","config"],"backgroundTag":null,"analyzedSha":"e01f97c6db397165050caa6764020410c2c8199a","analyzedAt":"2026-08-14T10:23:53.097Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}