{"record":{"id":"3bcbd50ec0689183","repo":"apache/seatunnel","slug":"transport-endpoint-must-be-non-empty","errorCode":null,"errorMessage":"transport.endpoint must be non-empty.","messagePattern":"transport\\.endpoint must be non-empty\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-edge-agent/seatunnel-edge-agent-transport/src/main/java/org/apache/seatunnel/edge/agent/transport/config/EdgeTransportEndpoints.java","lineNumber":45,"sourceCode":"    /**\n     * Validates {@code endpoint} format (same rules as EdgeSocket connector). Throws {@code\n     * IllegalArgumentException} when invalid.\n     */\n    public static void validateFormat(String endpoint) {\n        parseHostAndPort(endpoint);\n    }\n\n    /** Resolves {@code endpoint} to a socket address for {@link EdgeTransportClient}. */\n    public static InetSocketAddress toSocketAddress(String endpoint) {\n        HostPort hostPort = parseHostAndPort(endpoint);\n        return new InetSocketAddress(hostPort.host, hostPort.port);\n    }\n\n    private static HostPort parseHostAndPort(String endpoint) {\n        Objects.requireNonNull(endpoint, \"endpoint\");\n        String trimmed = endpoint.trim();\n        if (trimmed.isEmpty()) {\n            throw new IllegalArgumentException(\"transport.endpoint must be non-empty.\");\n        }\n        int separatorIndex = trimmed.lastIndexOf(':');\n        if (separatorIndex <= 0 || separatorIndex >= trimmed.length() - 1) {\n            throw new IllegalArgumentException(\n                    \"Invalid endpoint: \" + endpoint + \", expected format host:port\");\n        }\n        String host = trimmed.substring(0, separatorIndex);\n        String portText = trimmed.substring(separatorIndex + 1);\n        int port;\n        try {\n            port = Integer.parseInt(portText);\n        } catch (NumberFormatException parseException) {\n            throw new IllegalArgumentException(\n                    \"Invalid endpoint port in endpoint: \" + endpoint, parseException);\n        }\n        if (port < 1 || port > 65535) {\n            throw new IllegalArgumentException(\n                    \"transport.endpoint port must be a valid TCP port (1-65535), got: \" + port);","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-edge-agent/seatunnel-edge-agent-transport/src/main/java/org/apache/seatunnel/edge/agent/transport/config/EdgeTransportEndpoints.java#L27-L63","documentation":"EdgeTransportEndpoints.parseHostAndPort parses an endpoint string of the form host:port. After requiring a non-null endpoint, it trims it and throws IllegalArgumentException if the result is empty. This guards downstream parsing (lastIndexOf(':')) from meaningless input.","triggerScenarios":"Calling EdgeTransportEndpoints.hostPort or validateFormat with an endpoint string that is null-adjacent whitespace, e.g. \"\", \"   \", or a config value bound to an unset placeholder that resolved to blank.","commonSituations":"transport.endpoint left as empty string in the HOCON config; an env-substituted value (${TRANSPORT_ENDPOINT}) that resolved to nothing; programmatic construction with a blank default.","solutions":["Set transport.endpoint to a valid host:port, e.g. \"127.0.0.1:5800\".","If the value comes from an env var, ensure the variable is exported and non-empty before launching the agent.","Remove a leftover empty transport.endpoint key so validation fails with a clearer missing-config error or the default is used.","Add a startup sanity check on your deployment pipeline that the rendered config contains a non-blank endpoint."],"exampleFix":"// before\ntransport.endpoint = \"\"\n\n// after\ntransport.endpoint = \"192.168.1.10:5800\"","handlingStrategy":"validation","validationCode":"String endpoint = cfg.getString(\"transport.endpoint\");\nif (endpoint == null || endpoint.trim().isEmpty()) {\n    throw new IllegalStateException(\"transport.endpoint must be a non-empty host:port value\");\n}","typeGuard":"boolean isNonBlank(String s) { return s != null && !s.trim().isEmpty(); }","tryCatchPattern":"try {\n    EdgeTransportEndpoints.validateFormat(endpoint);\n} catch (IllegalArgumentException e) {\n    LOG.error(\"Rejecting blank/invalid transport.endpoint: check rendered config\", e);\n    throw e;\n}","preventionTips":["Fail deployment pipelines when env placeholders render to empty strings.","Always ship a concrete default endpoint value in config templates.","Validate endpoint non-blankness at process start, before network setup.","Use ${VAR:?err} shell syntax so unset variables abort before writing configs."],"tags":["config","endpoint","validation","empty-string"],"backgroundTag":"empty-required-field","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"}