{"record":{"id":"c055a30135921b4f","repo":"aeron-io/aeron","slug":"invalid-paramname-must-be-a-number","errorCode":null,"errorMessage":"invalid <paramName>, must be a number","messagePattern":"invalid <paramName>, must be a number","errorType":"exception","errorClass":"InvalidChannelException","httpStatus":null,"severity":"error","filePath":"aeron-driver/src/main/java/io/aeron/driver/PublicationParams.java","lineNumber":550,"sourceCode":"\n            if (maxResend <= 0 || maxResend > Configuration.MAX_RESEND_MAX)\n            {\n                throw new InvalidChannelException(\n                    \"invalid \" + MAX_RESEND_PARAM_NAME + \"=\" + maxResend +\n                    \", must be > 0 and <= \" + Configuration.MAX_RESEND_MAX);\n            }\n        }\n    }\n\n    private static int parseInt(final String value, final String paramName)\n    {\n        try\n        {\n            return Integer.parseInt(value);\n        }\n        catch (final NumberFormatException ex)\n        {\n            throw new InvalidChannelException(\n                \"invalid \" + paramName + \", must be a number\", ex);\n        }\n    }\n\n    private static long parseLong(final String value, final String paramName)\n    {\n        try\n        {\n            return Long.parseLong(value);\n        }\n        catch (final NumberFormatException ex)\n        {\n            throw new InvalidChannelException(\n                \"invalid \" + paramName + \", must be a number\", ex);\n        }\n    }\n\n    private static long parseResponseCorrelationId(final ChannelUri channelUri)","sourceCodeStart":532,"sourceCodeEnd":568,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-driver/src/main/java/io/aeron/driver/PublicationParams.java#L532-L568","documentation":"parseInt converts a channel URI parameter string to an int and throws InvalidChannelException when Integer.parseInt fails, i.e. the value is not a valid signed 32-bit integer. It is applied to params like stream-id, session-id, and max-resend when parsing publication params.","triggerScenarios":"Any channel URI param parsed as int contains non-numeric text (e.g. `session-id=abc`, `stream-id=1_000`, `max-resend=6.0`), or an empty value; the thrown message names the offending param.","commonSituations":"Interpolating strings/symbols into URI templates; locale-formatted numbers with separators or decimals; trailing whitespace; passing a session name instead of id; YAML/properties values silently typed as strings like '1024\\n'.","solutions":["Ensure the parameter value is a plain integer string, e.g. stream-id=1001","Trim whitespace and strip formatting from the value before building the URI","Log/echo the full channel URI in the InvalidChannelException cause to find which param is bad","Parse/validate with Integer.parseInt in your own config loader before constructing the URI"],"exampleFix":"// before\nString uri = \"aeron:udp?endpoint=localhost:40456|stream-id=\" + streamName; // streamName=\"market-data\"\n// after\nString uri = \"aeron:udp?endpoint=localhost:40456|stream-id=\" + Integer.parseInt(streamIdConfig);","handlingStrategy":"validation","validationCode":"int v;\ntry { v = Integer.parseInt(value.trim()); }\ncatch (NumberFormatException e) { throw new IllegalArgumentException(paramName + \" must be an integer, got: \" + value); }","typeGuard":"boolean isIntParam(String v) {\n    try { Integer.parseInt(v == null ? \"\" : v.trim()); return true; } catch (NumberFormatException e) { return false; }\n}","tryCatchPattern":"try { publication = aeron.addPublication(uri, streamId); }\ncatch (InvalidChannelException e) {\n    if (e.getCause() instanceof NumberFormatException) {\n        throw new ConfigurationException(\"Non-numeric URI parameter in: \" + uri, e);\n    } throw e;\n}","preventionTips":["Validate all numeric channel params at config load, before URI construction","Trim and canonicalize values interpolated into URI templates","Log the full channel URI on failure to identify the bad parameter"],"tags":["aeron","channel-uri","number-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-15T23:17:13.987Z"}