{"record":{"id":"126ee73861b26575","repo":"aeron-io/aeron","slug":"address-port-is-required-for-ipv4","errorCode":null,"errorMessage":"address:port is required for ipv4: ","messagePattern":"address:port is required for ipv4: ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"aeron-driver/src/main/java/io/aeron/driver/media/SocketAddressParser.java","lineNumber":156,"sourceCode":"\n                case PORT:\n                    if (c < '0' || '9' < c)\n                    {\n                        return null;\n                    }\n                    break;\n            }\n        }\n\n        if (-1 != separatorIndex && 1 < length - separatorIndex)\n        {\n            final String hostname = str.substring(0, separatorIndex);\n            final int portIndex = separatorIndex + 1;\n            final int port = AsciiEncoding.parseIntAscii(str, portIndex, length - portIndex);\n            return new ParseResult(hostname, port);\n        }\n\n        throw new IllegalArgumentException(\"address:port is required for ipv4: \" + str);\n    }\n\n    private static ParseResult tryParseIpV6(final String str)\n    {\n        IpV6State state = IpV6State.START_ADDR;\n        int portIndex = -1;\n        int scopeIndex = -1;\n        final int length = str.length();\n\n        for (int i = 0; i < length; i++)\n        {\n            final char c = str.charAt(i);\n\n            switch (state)\n            {\n                case START_ADDR:\n                    if ('[' == c)\n                    {","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-driver/src/main/java/io/aeron/driver/media/SocketAddressParser.java#L138-L174","documentation":"tryParseIpV4 throws IllegalArgumentException('address:port is required for ipv4: ' + str) when a string intended as IPv4 lacks the required host:port structure — most often the port portion is missing or the string does not contain a ':' separator at a valid position. It is a precise, IPv4-specific format check inside the state-machine parser.","triggerScenarios":"Parsing endpoints like '127.0.0.1' (no port), '127.0.0.1:' (empty port), ':40456' (no host), or strings where AsciiEncoding.parseIntAscii fails on the port digits.","commonSituations":"URI templates where the port variable was not substituted (endpoint=${host}); truncating the endpoint when building URIs programmatically; copy/paste dropping the port.","solutions":["Append the port to the IPv4 address, e.g. endpoint=192.168.1.10:40456","Verify any string templates or environment variables supplying the endpoint render both host and port","Validate with a regex like ^\\d{1,3}(\\.\\d{1,3}){3}:\\d+$ before passing to Aeron"],"exampleFix":"// before\n\"aeron:udp?endpoint=192.168.1.10\"\n// after\n\"aeron:udp?endpoint=192.168.1.10:40456\"","handlingStrategy":"validation","validationCode":"static boolean isValidIpv4Endpoint(String s) {\n    return s != null && s.matches(\"\\d{1,3}(\\.\\d{1,3}){3}:\\d+\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Require both host and port when templating endpoints (${host}:${port})","Fail fast on unresolved template placeholders before building URIs","Run URI validation as part of application startup"],"tags":["parsing","uri","ipv4"],"backgroundTag":"invalid-argument-format","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}