apache/dolphinscheduler · error · RuntimeException

datax task params is not valid

Error message

datax task params is not valid

What it means

A parameter validation guard in DataxTask.init: JSONUtils.parseObject returned null (unparseable taskParams JSON) or dataXParameters.checkParameters() found required fields missing — for custom JSON mode the json/datasource fields, for template mode the reader/writer selection. The offending input is the taskParams JSON in the task definition; the task fails before any command is built.

Source

Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-datax/src/main/java/org/apache/dolphinscheduler/plugin/task/datax/DataxTask.java:124

    private DataxTaskExecutionContext dataxTaskExecutionContext;

    public DataxTask(TaskExecutionContext taskExecutionContext) {
        super(taskExecutionContext);

        this.shellCommandExecutor = new ShellCommandExecutor(taskExecutionContext);
    }

    /**
     * init DataX config
     */
    @Override
    public void init() {
        dataXParameters = JSONUtils.parseObject(taskRequest.getTaskParams(), DataxParameters.class);
        log.info("Initialize datax task params {}", JSONUtils.toPrettyJsonString(dataXParameters));

        if (dataXParameters == null || !dataXParameters.checkParameters()) {
            throw new RuntimeException("datax task params is not valid");
        }
        SensitiveDataConverter.addMaskPattern(POST_JDBC_INFO_REGEX);
        dataxTaskExecutionContext =
                dataXParameters.generateExtendedContext(taskRequest.getResourceParametersHelper());
    }

    @SuppressWarnings("unchecked")
    @Override
    public void handle(TaskCallBack taskCallBack) throws TaskException {
        try {
            // replace placeholder,and combine local and global parameters
            Map<String, Property> paramsMap = taskRequest.getPrepareParamsMap();

            IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()
                    .properties(ParameterUtils.convert(paramsMap))
                    .appendScript(buildCommand(buildDataxJsonFile(paramsMap), paramsMap));

            TaskResponse commandExecuteResult = shellCommandExecutor.run(shellActuatorBuilder, taskCallBack);

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Open the task definition and complete the required DataX fields (datasource, json, or custom template parameters)
  2. Ensure the taskParams JSON deserializes into DataxParameters (no typos in field names, correct types)
  3. Use testHandleParamsMap-style validation in the UI to catch missing fields before saving
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-datax/src/main/java/org/apache/dolphinscheduler/plugin/task/datax/DataxTask.java:124 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/c710687678959df1. Report an issue: GitHub.