apache/seatunnel · error · IllegalArgumentException

Parameter 'pluginName' cannot be empty.

Error message

Parameter 'pluginName' cannot be empty.

What it means

OptionRulesService.normalizePluginName validates the pluginName path/query parameter used when looking up connector option rules. If the value is blank (null, empty, or whitespace-only) it throws IllegalArgumentException naming the parameter. The service requires a concrete plugin (source/sink/transform) name to resolve its OptionRule.

Source

Thrown at seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/service/OptionRulesService.java:217

        }
        if (StringUtils.equalsIgnoreCase(normalizedPluginType, PluginType.SINK.getType())) {
            return PluginType.SINK;
        }
        if (StringUtils.equalsIgnoreCase(normalizedPluginType, PluginType.TRANSFORM.getType())) {
            return PluginType.TRANSFORM;
        }
        throw new IllegalArgumentException(
                String.format(
                        "Unsupported plugin type '%s'. Only '%s', '%s' and '%s' are supported.",
                        normalizedPluginType,
                        PluginType.SOURCE.getType(),
                        PluginType.SINK.getType(),
                        PluginType.TRANSFORM.getType()));
    }

    private String normalizePluginName(String pluginName) {
        if (StringUtils.isBlank(pluginName)) {
            throw new IllegalArgumentException(
                    String.format("Parameter '%s' cannot be empty.", PARAM_PLUGIN));
        }
        return pluginName.trim().toLowerCase(Locale.ROOT);
    }

    private OptionRuleResponse.RequiredOptionMetadata toRequiredOptionMetadata(
            RequiredOption requiredOption) {
        List<OptionRuleResponse.OptionMetadata> options =
                requiredOption.getOptions().stream()
                        .map(this::toOptionMetadata)
                        .collect(Collectors.toList());
        OptionRuleResponse.RuleType ruleType = resolveRuleType(requiredOption);
        if (ruleType == null) {
            throw new IllegalArgumentException(
                    String.format(
                            "Unsupported required option type: %s",
                            requiredOption.getClass().getName()));
        }

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Pass a valid, non-blank plugin name in the URL or query parameter, e.g. /option-rules/FakeSource
  2. Trim user input client-side and reject blank values before calling the endpoint
  3. Use one of the supported plugin types (source/sink/transform plugin identifiers) that actually exist
  4. Return a 400 response with this message instead of a 500 from the generic exception handler

Example fix

// before
String url = base + "/option-rules/" + pluginName; // pluginName is ""
// after
if (pluginName == null || pluginName.isBlank()) {
    throw new IllegalArgumentException("pluginName must be provided");
}
String url = base + "/option-rules/" + pluginName.trim().toLowerCase(Locale.ROOT);
Defensive patterns

Strategy: validation

Validate before calling

if (pluginName == null || pluginName.isBlank()) throw new IllegalArgumentException("pluginName required");
String normalized = pluginName.trim().toLowerCase(Locale.ROOT);

Type guard

boolean isValidPluginName(String s) { return s != null && !s.isBlank(); }

Try / catch

try { callOptionRules(name); } catch (IllegalArgumentException e) { return 400; }

Prevention

When it happens

Trigger: Calling the REST option-rules endpoint (e.g. /option-rules/<pluginName>) with an empty path segment, a bare trailing slash, or a blank 'pluginName' query parameter.

Common situations: Client code builds the URL with an unset/empty variable; a proxy strips the path suffix; an upstream template renders ${plugin} as empty; manual curl invocation like GET /option-rules/ without a plugin name.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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