{"record":{"id":"8b60c20bf1b38107","repo":"apache/seatunnel","slug":"invalid-endpoint-port-in-endpoint-s","errorCode":null,"errorMessage":"Invalid endpoint port in endpoint: %s","messagePattern":"Invalid endpoint port in endpoint: (.+?)","errorType":"validation","errorClass":"OptionValidationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-edge-socket/src/main/java/org/apache/seatunnel/connectors/seatunnel/edgesocket/source/EdgeSocketSourceFactory.java","lineNumber":125,"sourceCode":"        public String description() {\n            return \"must be blank or in host:port format\";\n        }\n\n        @Override\n        public boolean evaluate(ReadonlyConfig config, String endpoint) {\n            if (endpoint == null || endpoint.trim().isEmpty()) {\n                return true;\n            }\n            int separatorIndex = endpoint.lastIndexOf(':');\n            if (separatorIndex <= 0 || separatorIndex >= endpoint.length() - 1) {\n                throw new OptionValidationException(\n                        \"Invalid endpoint: %s, expected format host:port\", endpoint);\n            }\n            String endpointPort = endpoint.substring(separatorIndex + 1);\n            try {\n                Integer.parseInt(endpointPort);\n            } catch (NumberFormatException parseException) {\n                throw new OptionValidationException(\n                        String.format(\"Invalid endpoint port in endpoint: %s\", endpoint),\n                        parseException);\n            }\n            return true;\n        }\n    }\n\n    private static class SecretKeyValidator implements ConditionExtension<String> {\n\n        @Override\n        public String description() {\n            return \"must decode to exactly 32 bytes when packet_mode is PACKET\";\n        }\n\n        @Override\n        public boolean evaluate(ReadonlyConfig config, String secretKey) {\n            if (secretKey == null) {\n                return true;","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-edge-socket/src/main/java/org/apache/seatunnel/connectors/seatunnel/edgesocket/source/EdgeSocketSourceFactory.java#L107-L143","documentation":"Endpoint validation rejects a host:port endpoint whose port segment cannot be parsed as an integer. The host and colon format passed, but Integer.parseInt on the substring after the last ':' threw NumberFormatException, wrapped as OptionValidationException during config validation.","triggerScenarios":"evaluate() is given an endpoint like \"host:abc\", \"host:70000\" (> Integer range throws NumberFormatException? — values above 2^31-1 fail parse), \"host:5100 \" (trailing space), or \"host:5100x\".","commonSituations":"Non-numeric port typos; port placeholder left unresolved (e.g. \"host:${PORT}\"); leading/trailing spaces or invisible characters from YAML/clipboard; oversized numeric values from bad templating.","solutions":["Set a numeric port, e.g. \"edge-node-01:5100\".","Trim whitespace and non-printable characters from the endpoint string.","Resolve template/placeholder variables before job submission so no '${...}' remains in the port.","Keep the port within valid range (1-65535)."],"exampleFix":"// before\nendpoint = \"edge-node-01:${PORT}\"\n// after\nendpoint = \"edge-node-01:5100\"","handlingStrategy":"validation","validationCode":"public static boolean isValidEndpoint(String endpoint) {\n    if (endpoint == null) return false;\n    int i = endpoint.lastIndexOf(':');\n    if (i <= 0 || i >= endpoint.length() - 1) return false;\n    String port = endpoint.substring(i + 1).trim();\n    try { int p = Integer.parseInt(port); return p >= 1 && p <= 65535; }\n    catch (NumberFormatException e) { return false; }\n}","typeGuard":null,"tryCatchPattern":"try {\n    factory.apply(config);\n} catch (OptionValidationException e) {\n    log.error(\"endpoint port invalid: {}\", e.getMessage());\n}","preventionTips":["Resolve template variables (e.g. ${PORT}) before submitting the job.","Trim whitespace from YAML values; quote strings containing special characters.","Keep ports within 1-65535 and numeric-only."],"tags":["config","validation","port","format"],"backgroundTag":"invalid-argument-format","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}