{"record":{"id":"04e87bcc80123f90","repo":"apache/seatunnel","slug":"invalid-endpoint-s-expected-format-host-port","errorCode":null,"errorMessage":"Invalid endpoint: %s, expected format host:port","messagePattern":"Invalid endpoint: (.+?), expected format host:port","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":118,"sourceCode":"    public Class<? extends SeaTunnelSource> getSourceClass() {\n        return EdgeSocketSource.class;\n    }\n\n    private static class EndpointValidator implements ConditionExtension<String> {\n\n        @Override\n        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() {","sourceCodeStart":100,"sourceCodeEnd":136,"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#L100-L136","documentation":"Endpoint validation in EdgeSocketSourceFactory's OptionValidation rule rejects an endpoint string that does not follow host:port. The check requires a ':' separator that is neither the first character nor the last character of the string. Thrown as OptionValidationException during config validation, before the job starts.","triggerScenarios":"evaluate() is called with an endpoint like \"host\" (no colon), \":8080\" (empty host), \"host:\" (empty port), or \"host:port:extra\" where lastIndexOf(':') yields an unusable split.","commonSituations":"Typing just a hostname without a port; copying an IPv6 literal like ::1 (colons confuse lastIndexOf-based parsing); trailing whitespace leaving an empty port segment; accidentally pasting a URL instead of host:port.","solutions":["Write the endpoint as host:port, e.g. \"192.168.1.10:5100\".","If using IPv6, bracket the host or use an address form compatible with the host:port parsing (lastIndexOf ':'), e.g. use a resolvable hostname instead of a raw IPv6 literal.","Trim whitespace and remove stray characters from the configured endpoint value.","Check the config file/CLI value for truncation (e.g. port lost during templating)."],"exampleFix":"// before\nendpoint = \"edge-node-01\"\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    try { Integer.parseInt(endpoint.substring(i + 1)); return true; }\n    catch (NumberFormatException e) { return false; }\n}","typeGuard":null,"tryCatchPattern":"try {\n    factory.apply(config);\n} catch (OptionValidationException e) {\n    log.error(\"endpoint config invalid: {}\", e.getMessage());\n}","preventionTips":["Always specify endpoints as host:port with a numeric port.","Avoid raw IPv6 literals in this field; use hostnames resolvable to the node.","Validate config with a dry-run/local parse before cluster deployment."],"tags":["config","validation","endpoint","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"}