apache/dolphinscheduler · error · TaskException

Convert json to task params failed

Error message

Convert json to task params failed

What it means

In initParams, when the task is in JSON format, objectMapper.readValue failed to convert the user-supplied JSON string into DatasyncParameters — the JSON is syntactically invalid or its fields do not match the DatasyncParameters schema. The offending input is parameters.getJson(); parsing happens before any AWS call, so nothing has been submitted.

Source

Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-datasync/src/main/java/org/apache/dolphinscheduler/plugin/task/datasync/DatasyncTask.java:89

    @Override
    public void init() {

        parameters = JSONUtils.parseObject(taskExecutionContext.getTaskParams(), DatasyncParameters.class);
        log.info("Initialize Datasync task params {}", JSONUtils.toPrettyJsonString(parameters));
        initParams();

        hook = new DatasyncHook();
    }

    /**
     * init datasync hook
     */
    public void initParams() throws TaskException {
        if (parameters.isJsonFormat() && StringUtils.isNotEmpty(parameters.getJson())) {
            try {
                parameters = objectMapper.readValue(parameters.getJson(), DatasyncParameters.class);
            } catch (JsonProcessingException e) {
                throw new TaskException("Convert json to task params failed", e);
            }
            log.info("Success convert json to task params {}", JSONUtils.toPrettyJsonString(parameters));
        }
    }

    @Override
    public void submitApplication() throws TaskException {
        try {
            int exitStatusCode = checkCreateTask();
            if (exitStatusCode == TaskConstants.EXIT_CODE_FAILURE) {
                // if create task failure go end
                setExitStatusCode(exitStatusCode);
                return;
            }
            // start task
            exitStatusCode = startDatasyncTask();
            setExitStatusCode(exitStatusCode);
        } catch (Exception e) {

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Validate the JSON in the task definition UI against the DatasyncParameters schema
  2. Check the Datasync task documentation for the expected JSON structure (e.g. required syncConfig fields)
  3. Ensure parameter placeholder substitution did not corrupt the JSON string
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-datasync/src/main/java/org/apache/dolphinscheduler/plugin/task/datasync/DatasyncTask.java:89 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/35941738faa4f921. Report an issue: GitHub.