{"record":{"id":"213c04fcfca6abb0","repo":"aeron-io/aeron","slug":"port-range-incorrect-format","errorCode":null,"errorMessage":"port range \"\" incorrect format","messagePattern":"port range \"\" incorrect format","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"aeron-driver/src/main/java/io/aeron/driver/media/WildcardPortManager.java","lineNumber":112,"sourceCode":"    }\n\n    /**\n     * Parse a port range in the format \"low high\".\n     *\n     * @param value for the port range in string format.\n     * @return port range as low index 0 and high index 1.\n     */\n    public static int[] parsePortRange(final String value)\n    {\n        if (null == value || value.isEmpty())\n        {\n            return EMPTY_PORT_RANGE;\n        }\n\n        final String[] ports = value.split(\" +\");\n        if (ports.length != 2)\n        {\n            throw new IllegalArgumentException(\"port range \\\"\" + value + \"\\\" incorrect format\");\n        }\n\n        final int[] portRange = new int[2];\n\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            }","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-driver/src/main/java/io/aeron/driver/media/WildcardPortManager.java#L94-L130","documentation":"WildcardPortManager.parsePortRange expects a port range value of the form '<min> <max>' (two whitespace-separated integers). A value that does not split into exactly two tokens produces IllegalArgumentException naming the offending value.","triggerScenarios":"Configuring the wildcard port range system property (aeron.wildcard.port.range) with zero, one, or three tokens — e.g. '40000', '40000-40100' (hyphen instead of space), or an empty string — then parsing the port range.","commonSituations":"Using '40000-40100' or '40000:40100' syntax instead of the required space-separated form, quoting issues stripping the space, or an unset/empty property.","solutions":["Format the value as two space-separated numbers, e.g. '40000 40100'.","Do not use hyphens, colons, or commas as separators.","Check quoting in your config/launcher so the space is preserved (shell/properties escaping)."],"exampleFix":"// before\n-Daeron.wildcard.port.range=40000-40100\n// after\n-Daeron.wildcard.port.range=\"40000 40100\"","handlingStrategy":"validation","validationCode":"String[] parts = rangeStr.trim().split(\" +\");\nif (parts.length != 2) {\n    throw new IllegalArgumentException(\"port range must be '<min> <max>', got: \" + rangeStr);\n}","typeGuard":null,"tryCatchPattern":"try {\n    portManager.parsePortRange(value);\n} catch (IllegalArgumentException e) {\n    logger.error(\"bad port range: {}\", e.getMessage());\n    // correct to space-separated form and reload config\n}","preventionTips":["Always quote the range in shell/launch scripts to preserve the space","Use whitespace separation, never hyphens or colons","Add a config validation step in deployment tooling"],"tags":["configuration","port-range","format","validation"],"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"}