apache/seatunnel · error · OptionValidationException

nodes[ ]: port is out of range [ , ]

Error message

nodes[%d]: port %d is out of range [%d, %d]

What it means

The port parsed from a `nodes` entry is a valid integer but outside the allowed range [MIN_PORT, MAX_PORT] (1-65535) enforced by RedisBaseOptions. RedisNodesValidator explicitly bounds-checks the parsed value after parsing. This rejects nonsensical ports like 0, negative numbers, or values above 65535.

Solutions

  1. Change the port to a value between 1 and 65535 (Redis default is 6379).
  2. Verify the actual Redis server port with `redis-cli -p <port> ping`.
  3. Remove any extra digits accidentally appended to the port.

Example fix

// before
nodes = ["127.0.0.1:99999"]
// after
nodes = ["127.0.0.1:6379"]
Defensive patterns

Strategy: validation

Validate before calling

int port = Integer.parseInt(node.substring(node.indexOf(':') + 1));
if (port < 1 || port > 65535) throw new IllegalArgumentException("port out of range: " + port);

Prevention

When it happens

Trigger: evaluate() gets a nodes entry such as '127.0.0.1:0', '127.0.0.1:99999', or '127.0.0.1:-1' where the port parses as an integer but violates RedisBaseOptions.MIN_PORT/MAX_PORT bounds.

Common situations: Confusing 16-bit port limits (typing 655360 or 100000), copy-paste of IPv6-like or other numeric junk after the host, or mistaking other port conventions (e.g. cluster bus port +10000 confusion).

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


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

Appendix: source

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

                        "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) {
                throw new OptionValidationException(
                        "nodes[%d]: port %d is out of range [%d, %d]",
                        i, port, RedisBaseOptions.MIN_PORT, RedisBaseOptions.MAX_PORT);
            }
        }
        return true;
    }
}

View on GitHub (pinned to cf67b549a7)