{"record":{"id":"d85fe9c47ad48c74","repo":"aeron-io/aeron","slug":"invalid-subnet-s","errorCode":null,"errorMessage":"invalid subnet: <s>","messagePattern":"invalid subnet: <s>","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"aeron-driver/src/main/java/io/aeron/driver/media/InterfaceSearchAddress.java","lineNumber":173,"sourceCode":"\n        final String addressString = getAddress(addressAndPort, slashIndex, colonIndex, rightAngleBraceIndex);\n        final InetAddress hostAddress = InetAddress.getByName(addressString);\n        final int port = getPort(addressAndPort, slashIndex, colonIndex, rightAngleBraceIndex);\n        final int defaultSubnetPrefix = hostAddress.getAddress().length * 8;\n        final int subnetPrefix = getSubnet(addressAndPort, slashIndex, defaultSubnetPrefix);\n\n        return new InterfaceSearchAddress(new InetSocketAddress(hostAddress, port), subnetPrefix);\n    }\n\n    private static int getSubnet(final String s, final int slashIndex, final int defaultSubnetPrefix)\n    {\n        if (slashIndex < 0)\n        {\n            return defaultSubnetPrefix;\n        }\n        else if (s.length() - 1 == slashIndex)\n        {\n            throw new IllegalArgumentException(\"invalid subnet: \" + s);\n        }\n\n        final int subnetStringBegin = slashIndex + 1;\n\n        return AsciiEncoding.parseIntAscii(s, subnetStringBegin, s.length() - subnetStringBegin);\n    }\n\n    private static int getPort(\n        final String s, final int slashIndex, final int colonIndex, final int rightAngleBraceIndex)\n    {\n        if (colonIndex < 0 || rightAngleBraceIndex > colonIndex)\n        {\n            return 0;\n        }\n        else if (s.length() - 1 == colonIndex)\n        {\n            throw new IllegalArgumentException(\"invalid port: \" + s);\n        }","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-driver/src/main/java/io/aeron/driver/media/InterfaceSearchAddress.java#L155-L191","documentation":"Thrown during InterfaceSearchAddress.getSubnet when the search-address string ends with a slash, leaving the subnet prefix empty (e.g. '10.0.0.1/'). The library cannot interpret an absent prefix after the delimiter. It surfaces via the subnetPrefix accessor.","triggerScenarios":"Configuring an interface search address like '192.168.0.1/' or '0.0.0.0:8080/' — a slash present but no digits following it.","commonSituations":"Hand-edited channel URI or driver config where the subnet prefix was deleted but the slash left behind; template configs with placeholders like 'host/port/' incompletely filled in.","solutions":["Either remove the trailing slash to use the default subnet prefix, or supply an explicit prefix length such as '/24'","Validate the address string format before passing it into the driver configuration","Search config files/URIs for dangling '/' characters in interface specifications"],"exampleFix":"// before\n\"192.168.0.1:40456/\"\n// after\n\"192.168.0.1:40456/24\"  // or \"192.168.0.1:40456\"","handlingStrategy":"validation","validationCode":"// reject dangling subnet slash before use\nstatic boolean validSubnetSpec(String s) {\n    int i = s.lastIndexOf('/');\n    return i < 0 || (i < s.length() - 1 && s.substring(i + 1).chars().allMatch(Character::isDigit));\n}","typeGuard":"null","tryCatchPattern":"try {\n    addr.subnetPrefix();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"invalid subnet: \")) {\n        // strip the trailing slash and retry with default prefix\n    } else { throw e; }\n}","preventionTips":["Never leave a trailing '/' in interface spec strings","Regex-validate interface specs like ^[A-Za-z0-9.:\\-]+(:\\d+)?(/\\d{1,3})?$ before use","Review hand-edited driver configs for dangling delimiters"],"tags":["validation","aeron","configuration","subnet"],"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"}