apache/seatunnel · error · HugeGraphConnectorException

ILLEGAL_CONFIG_ARGUMENT

ILLEGAL_CONFIG_ARGUMENT

Error message

Option 'page_size' must be in range [%s, %s], but got %s

What it means

HugeGraphSourceConfig.validate enforces that the 'page_size' option lies within [MIN_PAGE_SIZE, MAX_PAGE_SIZE] defined in HugeGraphSourceOptions. Out-of-range values would create overly large or degenerate paged Gremlin queries, so the connector throws ILLEGAL_CONFIG_ARGUMENT at config construction.

Source

Thrown at seatunnel-connectors-v2/connector-hugegraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/config/HugeGraphSourceConfig.java:106

                config.getOptional(HugeGraphSourceOptions.LABEL_TYPE)
                        .orElse(HugeGraphSourceOptions.LABEL_TYPE.defaultValue()));
        sourceConfig.setSchema(null);
        sourceConfig.setPageSize(
                config.getOptional(HugeGraphSourceOptions.PAGE_SIZE)
                        .orElse(HugeGraphSourceOptions.PAGE_SIZE.defaultValue()));
        sourceConfig.setSplitSize(
                config.getOptional(HugeGraphSourceOptions.SPLIT_SIZE)
                        .orElse(HugeGraphSourceOptions.SPLIT_SIZE.defaultValue()));
        config.getOptional(HugeGraphSourceOptions.TIME_ZONE).ifPresent(sourceConfig::setTimeZone);
        validate(sourceConfig);
        return sourceConfig;
    }

    private static void validate(HugeGraphSourceConfig sourceConfig) {
        int pageSize = sourceConfig.getPageSize();
        if (pageSize < HugeGraphSourceOptions.MIN_PAGE_SIZE
                || pageSize > HugeGraphSourceOptions.MAX_PAGE_SIZE) {
            throw new HugeGraphConnectorException(
                    HugeGraphConnectorErrorCode.ILLEGAL_CONFIG_ARGUMENT,
                    String.format(
                            "Option 'page_size' must be in range [%s, %s], but got %s",
                            HugeGraphSourceOptions.MIN_PAGE_SIZE,
                            HugeGraphSourceOptions.MAX_PAGE_SIZE,
                            pageSize));
        }

        if (sourceConfig.getSplitSize() < HugeGraphSourceOptions.MIN_SPLIT_SIZE) {
            throw new HugeGraphConnectorException(
                    HugeGraphConnectorErrorCode.ILLEGAL_CONFIG_ARGUMENT,
                    String.format(
                            "Option 'split_size' must be at least %s bytes (the HugeGraph minimum "
                                    + "shard size); a smaller value would split the keyspace into a "
                                    + "huge number of shards and risk OOM / oversized checkpoints. "
                                    + "Got %s.",
                            HugeGraphSourceOptions.MIN_SPLIT_SIZE, sourceConfig.getSplitSize()));
        }

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set 'page_size' to a value within the range shown in the message (e.g. 500)
  2. Check HugeGraphSourceOptions.MIN_PAGE_SIZE / MAX_PAGE_SIZE for the exact bounds
  3. Remove the option entirely to use the documented default

Example fix

// before
page_size = 0
// after
page_size = 500
Defensive patterns

Strategy: validation

Validate before calling

int ps = config.getInt("page_size");
if (ps < MIN_PAGE_SIZE || ps > MAX_PAGE_SIZE) throw new IllegalArgumentException("page_size out of range");

Try / catch

try { HugeGraphSourceConfig.of(config); } catch (HugeGraphConnectorException e) { if (e.getCode() == ILLEGAL_CONFIG_ARGUMENT) log.error("Fix page_size: {}", e.getMessage()); }

Prevention

When it happens

Trigger: Calling HugeGraphSourceConfig.of(...) or ofReadAll(...) with 'page_size' set below MIN_PAGE_SIZE or above MAX_PAGE_SIZE.

Common situations: Typo like page_size = 0 or negative values; copying a huge page size from another connector; assuming page_size is unlimited and setting e.g. 1000000.

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