apache/dolphinscheduler · error · IllegalArgumentException
invalid code :
Error message
invalid code :
What it means
InputType.of(Integer) throws IllegalArgumentException when the given code is not a key of VALUES_MAP. InputType enumerates how data-quality inputs are provided (e.g. realtime vs offline source parameters); an unmapped code means the input type in data-quality task parameters is not defined in this build.
Source
Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/enums/dp/InputType.java:70
}
public String getDescription() {
return description;
}
private static final Map<Integer, InputType> VALUES_MAP = new HashMap<>();
static {
for (InputType type : InputType.values()) {
VALUES_MAP.put(type.code, type);
}
}
public static InputType of(Integer status) {
if (VALUES_MAP.containsKey(status)) {
return VALUES_MAP.get(status);
}
throw new IllegalArgumentException("invalid code : " + status);
}
}
View on GitHub (pinned to 02eac45a1b)
Solutions
- Check the inputType value in the data-quality task parameters against InputType's defined codes and fix it.
- Reference InputType enum constants instead of raw integers when constructing parameters.
- Align parameter producer and data-quality module versions so codes match.
- Validate membership in InputType's map before calling of() when input is external.
Example fix
// before
InputType inputType = InputType.of(params.getInteger("inputType"));
// after: validate then parse
Integer code = params.getInteger("inputType");
if (code == null) {
throw new IllegalArgumentException("inputType is required");
}
InputType inputType = InputType.of(code); Defensive patterns
Strategy: validation
Validate before calling
static boolean isKnownInputType(Integer code) {
return code != null && Arrays.stream(InputType.values()).anyMatch(t -> t.getCode().equals(code));
} Type guard
static Optional<InputType> safeOf(Integer status) {
if (status == null) return Optional.empty();
return Arrays.stream(InputType.values())
.filter(t -> t.getCode().equals(status))
.findFirst();
} Try / catch
try {
inputType = InputType.of(code);
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException("inputType " + code + " is not a valid data-quality input type", e);
} Prevention
- Null-check inputType before parsing; of() does not tolerate null keys.
- Avoid reusing numeric codes across DataType/OperatorType/InputType.
- Generate data-quality params programmatically from the enums to keep codes consistent.
- Re-validate imported workflow definitions against the target version's enums.
When it happens
Trigger: Calling InputType.of() with an Integer missing from VALUES_MAP — typically when the data-quality task params JSON carries an unknown inputType, or a caller reuses codes from a sibling enum (DataType, OperatorType).
Common situations: Hand-built data-quality parameter templates; API clients sending wrong numeric input types; workflow definitions persisted by a different DolphinScheduler version with divergent InputType codes.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- invalid code :
- invalid code :
- The task execution status code: %s is invalidated
- invalid code :
- invalid code :
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/75ade32ddb10e003.
Report an issue: GitHub.