apache/seatunnel · error · OptionValidationException

nodes[%d]: must be in 'host:port' format, got: %s

Error message

nodes[%d]: must be in 'host:port' format, got: %s

What it means

Thrown by RedisNodesValidator.evaluate when an entry of the redis 'nodes' option is not in 'host:port' format (fails NODE_PATTERN or is null), or when the host part is empty. It raises OptionValidationException with a message including the offending index and value, failing config validation before the job runs.

Source

Thrown at seatunnel-connectors-v2/connector-redis/src/main/java/org/apache/seatunnel/connectors/seatunnel/redis/config/RedisNodesValidator.java:46

    private static final Pattern NODE_PATTERN = Pattern.compile("^[^:]+:\\d+$");

    @Override
    public String description() {
        return "each node must be in 'host:port' format with port in ["
                + RedisBaseOptions.MIN_PORT
                + ", "
                + RedisBaseOptions.MAX_PORT
                + "]";
    }

    @Override
    public boolean evaluate(ReadonlyConfig config, List<String> value)
            throws OptionValidationException {
        for (int i = 0; i < value.size(); i++) {
            String node = value.get(i);
            if (node == null || !NODE_PATTERN.matcher(node).matches()) {
                throw new OptionValidationException(
                        "nodes[%d]: must be in 'host:port' format, got: %s", i, node);
            }
            int colon = node.indexOf(':');
            String host = node.substring(0, colon);
            if (host.trim().isEmpty()) {
                throw new OptionValidationException(
                        "nodes[%d]: host must not be blank in 'host:port', got: %s", i, node);
            }
            String portStr = node.substring(colon + 1);
            int port;
            try {
                port = Integer.parseInt(portStr);
            } catch (NumberFormatException e) {
                throw new OptionValidationException(
                        "nodes[%d]: port '%s' is out of range [%d, %d]",
                        i, portStr, RedisBaseOptions.MIN_PORT, RedisBaseOptions.MAX_PORT);
            }
            if (port < RedisBaseOptions.MIN_PORT || port > RedisBaseOptions.MAX_PORT) {

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Change the node entry to plain 'host:port' form, e.g. '127.0.0.1:6379' — strip schemes, paths, and extra protocol prefixes
  2. Split comma-separated node strings into separate list elements
  3. Add the port explicitly (default 6379) even if the server uses it
  4. For IPv6 hosts, check the validator's NODE_PATTERN — bracket or reformat as required by the pattern

Example fix

// before
nodes = ["redis://10.0.0.1:6379", "10.0.0.2,10.0.0.3:6379"]
// after
nodes = ["10.0.0.1:6379", "10.0.0.2:6379", "10.0.0.3:6379"]
Defensive patterns

Strategy: validation

Validate before calling

Pattern NODE_PATTERN = Pattern.compile("^[^:]+:\\d+$");
for (String n : nodes) {
  if (n == null || !NODE_PATTERN.matcher(n.trim()).matches()) throw new IllegalArgumentException("bad node: " + n);
}

Try / catch

try { validator.evaluate(config, nodeList); } catch (OptionValidationException e) {
  // read e.getMessage() for offending index/value and correct the config before resubmitting
}

Prevention

When it happens

Trigger: Job config lists redis nodes (cluster/sentinel mode) and any element lacks host:port — e.g. missing port, extra scheme ('redis://host:6379'), spaces, empty host ('':6379), or a comma-separated single string instead of a list.

Common situations: Users paste a Redis URL instead of host:port; port omitted because default 6379 was assumed; copying 'host1:6379,host2:6379' into one list element; IPv6 addresses not matching the pattern; leading/trailing whitespace.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


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