{"record":{"id":"059c4c5f5b8bb805","repo":"aeron-io/aeron","slug":"invalid-port-value-value","errorCode":null,"errorMessage":"invalid port value ${value}","messagePattern":"invalid port value (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"aeron-driver/src/main/java/io/aeron/driver/media/WildcardPortManager.java","lineNumber":134,"sourceCode":"\n        try\n        {\n            portRange[0] = Integer.parseUnsignedInt(ports[0]);\n            portRange[1] = Integer.parseUnsignedInt(ports[1]);\n\n            if (portRange[0] > 65535 || portRange[1] > 65535)\n            {\n                throw new NumberFormatException(value + \":port must be an integer value between 0 and 65535\");\n            }\n\n            if (portRange[0] > portRange[1])\n            {\n                throw new NumberFormatException(value + \":low port value must be lower than high port value\");\n            }\n        }\n        catch (final NumberFormatException ex)\n        {\n            throw new IllegalArgumentException(\"invalid port value \" + value, ex);\n        }\n\n        return portRange;\n    }\n\n    private int findOpenPort()\n    {\n        for (int i = nextPort; i <= highPort; i++)\n        {\n            if (!portSet.contains(i))\n            {\n                return i;\n            }\n        }\n\n        for (int i = lowPort; i < nextPort; i++)\n        {\n            if (!portSet.contains(i))","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-driver/src/main/java/io/aeron/driver/media/WildcardPortManager.java#L116-L152","documentation":"This is the wrapping IllegalArgumentException thrown in parsePortRange's catch block whenever the raw range string fails parsing or validation (non-numeric, >65535, or low>high). The original NumberFormatException is attached as the cause, and the offending value is included in the message.","triggerScenarios":"Any malformed wildcard port-range value passed to WildcardPortManager: non-numeric text, negative numbers, bounds over 65535, or reversed bounds.","commonSituations":"Environment variables or property files supplying the driver's wildcard port range with typos, wrong separators (',' instead of '-'), or unset placeholders like '${range}' reaching the parser.","solutions":["Inspect the cause (getCause()) to see whether it was a parse failure, out-of-range, or ordering problem.","Correct the range string to '<low>-<high>' with both values in 0-65535 and low <= high.","Add startup-time validation of the config value before constructing the driver media layer.","Log the exact configured value so operators can spot placeholder or typo issues."],"exampleFix":"// before\nString range = System.getProperty(\"aeron.ports\", \"${range}\");\n// after\nString range = System.getProperty(\"aeron.ports\", \"10000-20000\");","handlingStrategy":"try-catch","validationCode":"java.util.regex.Pattern RANGE = Pattern.compile(\"^(\\\\d+)-(\\\\d+)$\");\nMatcher m = RANGE.matcher(value); if (!m.matches()) throw new IllegalArgumentException(\"bad range: \" + value);","typeGuard":null,"tryCatchPattern":"try { parse(value); } catch (IllegalArgumentException e) { log.error(\"port range '{}' invalid, cause: {}\", value, e.getCause()); }","preventionTips":["Always inspect getCause() to distinguish parse vs range vs ordering failures","Reject placeholders and empty values before parsing","Centralize range parsing in one validated helper"],"tags":["java","aeron-driver","configuration","invalid-input"],"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-16T04:17:20.429Z"}