apache/seatunnel · error · org.apache.seatunnel.api.configuration.util.OptionValidationException

Required option ' ' should have no default value.

Error message

Required option '%s' should have no default value.

What it means

A developer-facing consistency guard in OptionRule.Builder.verifyRequiredOptionDefaultValue: an option marked as required in the rule was also given a default value, which is contradictory since a required option must be explicitly supplied by the user. The faulting input is the required Option with a non-null defaultValue.

Solutions

  1. Remove the defaultValue from the required Option definition
  2. If the option is optional with a default, declare it via Builder.optional(...) instead
  3. Fix the connector's OptionRule definition code, not the user config
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/OptionRule.java:454 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at seatunnel-api/src/main/java/org/apache/seatunnel/api/configuration/util/OptionRule.java:454

                                Collections.emptyList(),
                                newRequired,
                                Collections.emptyList(),
                                newConditions));
            }
        }

        public OptionRule build() {
            List<ConditionRule> conditionRuleList =
                    conditionRulesMap.entrySet().stream()
                            .map(e -> new ConditionRule(e.getKey(), e.getValue()))
                            .collect(Collectors.toList());
            return new OptionRule(
                    optionalOptions, requiredOptions, conditionRuleList, valueConstraints);
        }

        private void verifyRequiredOptionDefaultValue(@NonNull Option<?> option) {
            if (option.defaultValue() != null) {
                throw new OptionValidationException(
                        String.format(
                                "Required option '%s' should have no default value.",
                                option.key()));
            }
        }

        private void verifyDuplicateWithOptionOptions(
                @NonNull Option<?> option, @NonNull String currentOptionType) {
            if (optionalOptions.contains(option)) {
                throw new OptionValidationException(
                        String.format(
                                "%s '%s' duplicate in option options.",
                                currentOptionType, option.key()));
            }
        }

        private void verifyRequiredOptionDuplicate(@NonNull RequiredOption requiredOption) {
            verifyRequiredOptionDuplicate(requiredOption, false);

View on GitHub (pinned to cf67b549a7)