{"record":{"id":"037d0abb18849678","repo":"apache/seatunnel","slug":"the-server-id-serveridvalue-is-not-a-valid-nume","errorCode":null,"errorMessage":"The server id ${serverIdValue} is not a valid numeric.","messagePattern":"The server id (.+?) is not a valid numeric\\.","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/config/ServerIdRange.java","lineNumber":113,"sourceCode":"            if (idArray.length != 2) {\n                throw new IllegalArgumentException(\n                        String.format(\n                                \"The server id range should be syntax like '5400-5500', but got: %s\",\n                                range));\n            }\n            return new ServerIdRange(\n                    parseServerId(idArray[0].trim()), parseServerId(idArray[1].trim()));\n        } else {\n            long serverId = parseServerId(range);\n            return new ServerIdRange(serverId, serverId);\n        }\n    }\n\n    private static long parseServerId(String serverIdValue) {\n        try {\n            return Long.parseLong(serverIdValue);\n        } catch (NumberFormatException e) {\n            throw new IllegalStateException(\n                    String.format(\"The server id %s is not a valid numeric.\", serverIdValue), e);\n        }\n    }\n}\n","sourceCodeStart":95,"sourceCodeEnd":118,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-mysql/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/mysql/config/ServerIdRange.java#L95-L118","documentation":"ServerIdRange.parseServerId converts each boundary of the server-id range from String to long via Long.parseLong. If a boundary is not a valid integer (letters, empty string, decimals), an IllegalStateException wrapping the NumberFormatException is thrown, stating the offending value.","triggerScenarios":"server-id range like '5400-abc', '54.0-5500', or '5400-' where a boundary fails Long.parseLong; also called from the single-value serverId path when the whole value is non-numeric.","commonSituations":"Typos ('54oo-5500'); trailing spaces around non-trimmed values in some config sources; quotes/brackets accidentally included; using an IP-like or UUID string as server id.","solutions":["Use plain integer boundaries in the range, e.g. 5400-5500.","Strip stray whitespace or quote characters from the configured value.","Confirm the value is numeric end-to-end (regex ^\\d+(-\\d+)?$) before applying config.","Remember server ids are unsigned longs in MySQL — no decimals or signs."],"exampleFix":"// before\nserver-id = 5400-550O  // letter O instead of zero\n// after\nserver-id = 5400-5500","handlingStrategy":"validation","validationCode":"// Check numeric boundaries before parsing\nfor (String part : rangeStr.split(\"-\")) {\n    if (!part.trim().matches(\"\\\\d+\")) {\n        throw new IllegalArgumentException(\"Non-numeric server id boundary: \" + part);\n    }\n}","typeGuard":null,"tryCatchPattern":"try { ServerIdRange.from(value); } catch (IllegalStateException e) { /* fix the offending boundary to a plain integer */ throw e; }","preventionTips":["Avoid look-alike characters (letter O vs zero) in config values.","Trim whitespace from config values before passing them in.","Add a config-lint step rejecting non-integer server ids."],"tags":["configuration","parsing","server-id","numeric"],"backgroundTag":"invalid-argument-value","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}