apache/seatunnel · error · IllegalArgumentException

transport.endpoint must be non-empty.

Error message

transport.endpoint must be non-empty.

What it means

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.

Source

Thrown at seatunnel-edge-agent/seatunnel-edge-agent-transport/src/main/java/org/apache/seatunnel/edge/agent/transport/config/EdgeTransportEndpoints.java:45

    /**
     * Validates {@code endpoint} format (same rules as EdgeSocket connector). Throws {@code
     * IllegalArgumentException} when invalid.
     */
    public static void validateFormat(String endpoint) {
        parseHostAndPort(endpoint);
    }

    /** Resolves {@code endpoint} to a socket address for {@link EdgeTransportClient}. */
    public static InetSocketAddress toSocketAddress(String endpoint) {
        HostPort hostPort = parseHostAndPort(endpoint);
        return new InetSocketAddress(hostPort.host, hostPort.port);
    }

    private static HostPort parseHostAndPort(String endpoint) {
        Objects.requireNonNull(endpoint, "endpoint");
        String trimmed = endpoint.trim();
        if (trimmed.isEmpty()) {
            throw new IllegalArgumentException("transport.endpoint must be non-empty.");
        }
        int separatorIndex = trimmed.lastIndexOf(':');
        if (separatorIndex <= 0 || separatorIndex >= trimmed.length() - 1) {
            throw new IllegalArgumentException(
                    "Invalid endpoint: " + endpoint + ", expected format host:port");
        }
        String host = trimmed.substring(0, separatorIndex);
        String portText = trimmed.substring(separatorIndex + 1);
        int port;
        try {
            port = Integer.parseInt(portText);
        } catch (NumberFormatException parseException) {
            throw new IllegalArgumentException(
                    "Invalid endpoint port in endpoint: " + endpoint, parseException);
        }
        if (port < 1 || port > 65535) {
            throw new IllegalArgumentException(
                    "transport.endpoint port must be a valid TCP port (1-65535), got: " + port);

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set transport.endpoint to a valid host:port, e.g. "127.0.0.1:5800".
  2. If the value comes from an env var, ensure the variable is exported and non-empty before launching the agent.
  3. Remove a leftover empty transport.endpoint key so validation fails with a clearer missing-config error or the default is used.
  4. Add a startup sanity check on your deployment pipeline that the rendered config contains a non-blank endpoint.

Example fix

// before
transport.endpoint = ""

// after
transport.endpoint = "192.168.1.10:5800"
Defensive patterns

Strategy: validation

Validate before calling

String endpoint = cfg.getString("transport.endpoint");
if (endpoint == null || endpoint.trim().isEmpty()) {
    throw new IllegalStateException("transport.endpoint must be a non-empty host:port value");
}

Type guard

boolean isNonBlank(String s) { return s != null && !s.trim().isEmpty(); }

Try / catch

try {
    EdgeTransportEndpoints.validateFormat(endpoint);
} catch (IllegalArgumentException e) {
    LOG.error("Rejecting blank/invalid transport.endpoint: check rendered config", e);
    throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/3bcbd50ec0689183. Report an issue: GitHub.