apache/seatunnel · error · NebulaGraphConnectorException

INVALID_CONFIG

INVALID_CONFIG

Error message

Option 'hosts' must contain at least one graphd address.

What it means

NebulaGraphSinkConfig.parseHosts throws this when the 'hosts' option is null or an empty list. The NebulaGraph sink needs at least one graphd address to establish a session. It fails fast at config parsing time instead of failing later during connection.

Solutions

  1. Add the 'hosts' option to the NebulaGraph sink config with at least one graphd address, e.g. hosts = ["127.0.0.1:9669"].
  2. If using variable substitution, confirm the substituted value is non-empty at job submission time.
  3. Verify the option name is exactly 'hosts' for this connector and not a variant like 'graph_hosts'.

Example fix

// before
NebulaGraph {
  url = "..."
}
// after
NebulaGraph {
  hosts = ["graphd0:9669", "graphd1:9669"]
  url = "..."
}
Defensive patterns

Strategy: validation

Validate before calling

List<String> hosts = config.get("hosts");
if (hosts == null || hosts.isEmpty()) {
    throw new IllegalArgumentException("hosts must list at least one graphd address, e.g. [\"graphd0:9669\"]");
}

Prevention

When it happens

Trigger: NebulaGraphSinkConfig.of(config) -> parseHosts(config.get(HOSTS)) where HOSTS is not configured in the sink options, or configured as an empty list.

Common situations: User forgot the hosts option in the SeaTunnel config HOCON file; templating/env substitution left the list empty; copy-pasted a config for a different connector that uses a different option name.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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

Appendix: source

Thrown at seatunnel-connectors-v2/connector-nebulagraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/nebulagraph/config/NebulaGraphSinkConfig.java:80

                requirePositive(config.get(NebulaGraphSinkOptions.BATCH_SIZE), "batch_size");
        this.timeoutMillis =
                requirePositive(
                        config.get(NebulaGraphSinkOptions.TIMEOUT_MILLIS), "timeout_millis");
        this.maxRetries =
                requireNonNegative(config.get(NebulaGraphSinkOptions.MAX_RETRIES), "max_retries");
        this.retryIntervalMillis =
                requireNonNegative(
                        config.get(NebulaGraphSinkOptions.RETRY_INTERVAL_MILLIS),
                        "retry_interval_millis");
    }

    public static NebulaGraphSinkConfig of(ReadonlyConfig config) {
        return new NebulaGraphSinkConfig(config);
    }

    private static List<HostAddress> parseHosts(List<String> values) {
        if (values == null || values.isEmpty()) {
            throw invalid("Option 'hosts' must contain at least one graphd address.");
        }
        List<HostAddress> result = new ArrayList<>(values.size());
        for (String value : values) {
            result.add(parseHost(value));
        }
        return Collections.unmodifiableList(result);
    }

    static HostAddress parseHost(String value) {
        String address = requireNotBlank(value, "hosts").trim();
        String host;
        String portText;
        if (address.startsWith("[")) {
            int bracket = address.indexOf(']');
            if (bracket <= 1
                    || bracket + 1 >= address.length()
                    || address.charAt(bracket + 1) != ':') {
                throw invalid("Invalid graphd address '" + value + "'. Expected [ipv6]:port.");

View on GitHub (pinned to cf67b549a7)