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
- Set 'page_size' to a value within the range shown in the message (e.g. 500)
- Check HugeGraphSourceOptions.MIN_PAGE_SIZE / MAX_PAGE_SIZE for the exact bounds
- 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
- Keep page_size between the documented MIN/MAX bounds (default ~500)
- Never set page_size to 0 or negative values
- Clamp user input programmatically before building the config
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
- Option 'field_delimiter' cannot be empty
- Option 'batch_size' must be between 1 and 32
- Option 'visibility_timeout_seconds' must be between 1 and 60
- Option 'poll_interval_ms' must be greater than zero
- Option 'max_in_flight_messages' must be greater than or equa
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/7d3185b857517b28.
Report an issue: GitHub.