apache/seatunnel · error · HugeGraphConnectorException

HugeGraphConnectorErrorCode.ILLEGAL_CONFIG_ARGUMENT

HugeGraphConnectorErrorCode.ILLEGAL_CONFIG_ARGUMENT

Error message

The '%s' can't be null

What it means

Null branch of E.checkNotEmpty(collection, elem): throws when the named collection is null (message 'The %s can't be null', code HugeGraphConnectorErrorCode.ILLEGAL_CONFIG_ARGUMENT). Distinguishes 'not provided at all' from 'provided but empty'.

Solutions

  1. Add the missing collection option to the config
  2. Fix the option key spelling to match the documented Option
  3. Initialize the collection when building configs programmatically

Example fix

// before: no 'labels' key
// after
labels = ["person", "company"]
Defensive patterns

Strategy: validation

Validate before calling

if (cfg.get("labels") == null) {
    throw new IllegalArgumentException("labels is required");
}

Type guard

boolean isProvidedCollection(Map<String,Object> cfg, String key) { return cfg.get(key) instanceof Collection; }

Try / catch

try {
    source.prepare(config);
} catch (HugeGraphConnectorException e) {
    if (String.valueOf(e.getMessage()).matches("The '.*' can't be null")) {
        // add the missing list option
    }
    throw e;
}

Prevention

When it happens

Trigger: The named collection option is entirely missing from the config so the connector receives null when checking non-emptiness.

Common situations: Required list option omitted in the job HOCON; key typo so the option resolves to null; programmatic config builders skipping the field.

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/1090b4fafbfd278b. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-connectors-v2/connector-hugegraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/utils/E.java:52

        }
    }

    public static void checkNotNull(Object object, String elem, String owner) {
        if (object == null) {
            throw new HugeGraphConnectorException(
                    HugeGraphConnectorErrorCode.ILLEGAL_CONFIG_ARGUMENT,
                    String.format("The '%s' of '%s' can't be null", elem, owner));
        }
    }

    public static void checkNotEmpty(Collection<?> collection, String elem) {
        if (collection == null) {
            throw new HugeGraphConnectorException(
                    HugeGraphConnectorErrorCode.ILLEGAL_CONFIG_ARGUMENT,
                    String.format("The '%s' can't be null", elem));
        }
        if (collection.isEmpty()) {
            throw new HugeGraphConnectorException(
                    HugeGraphConnectorErrorCode.ILLEGAL_CONFIG_ARGUMENT,
                    String.format("The '%s' can't be empty", elem));
        }
    }

    public static void checkNotEmpty(Collection<?> collection, String elem, String owner) {
        if (collection == null) {
            throw new HugeGraphConnectorException(
                    HugeGraphConnectorErrorCode.ILLEGAL_CONFIG_ARGUMENT,
                    String.format("The '%s' of '%s' can't be null", elem, owner));
        }
        if (collection.isEmpty()) {
            throw new HugeGraphConnectorException(
                    HugeGraphConnectorErrorCode.ILLEGAL_CONFIG_ARGUMENT,
                    String.format("The '%s' of '%s' can't be empty", elem, owner));
        }
    }

View on GitHub (pinned to cf67b549a7)