apache/dolphinscheduler · error · RuntimeException
mapreduce task params is not valid
Error message
mapreduce task params is not valid
What it means
A parameter validation guard in MapReduceTask.init: mapreduceParameters is null after parsing taskParams (invalid JSON) or checkParameters() failed because required fields (main jar, main class, program arguments as applicable) are missing. The offending input is the taskParams JSON in the task definition; the task fails before the hadoop command is built.
Source
Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-mr/src/main/java/org/apache/dolphinscheduler/plugin/task/mr/MapReduceTask.java:61
private MapReduceParameters mapreduceParameters;
private final TaskExecutionContext taskExecutionContext;
public MapReduceTask(TaskExecutionContext taskExecutionContext) {
super(taskExecutionContext);
this.taskExecutionContext = taskExecutionContext;
}
@Override
public void init() {
this.mapreduceParameters =
JSONUtils.parseObject(taskExecutionContext.getTaskParams(), MapReduceParameters.class);
// check parameters
if (mapreduceParameters == null || !mapreduceParameters.checkParameters()) {
throw new RuntimeException("mapreduce task params is not valid");
}
// replace placeholder,and combine local and global parameters
Map<String, Property> paramsMap = taskExecutionContext.getPrepareParamsMap();
String args = ParameterUtils.convertParameterPlaceholders(mapreduceParameters.getMainArgs(),
ParameterUtils.convert(paramsMap));
mapreduceParameters.setMainArgs(args);
if (mapreduceParameters.getProgramType() != null
&& mapreduceParameters.getProgramType() == ProgramType.PYTHON) {
String others = ParameterUtils.convertParameterPlaceholders(mapreduceParameters.getOthers(),
ParameterUtils.convert(paramsMap));
mapreduceParameters.setOthers(others);
}
log.info("Initialize mapreduce task params {}", JSONUtils.toPrettyJsonString(mapreduceParameters));
}
/**View on GitHub (pinned to 02eac45a1b)
Solutions
- Complete the required MapReduce fields (mainJar, mainClass) in the task definition
- Ensure taskParams JSON deserializes into MapReduceParameters — check field names/types
- Validate on save in the UI to surface missing fields before execution
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-mr/src/main/java/org/apache/dolphinscheduler/plugin/task/mr/MapReduceTask.java:61 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/294bd3d5dea0c2cb.
Report an issue: GitHub.