apache/dolphinscheduler · error · TaskException

${e.getMessage()}

Error message

${e.getMessage()}

What it means

convertJsonParameters re-parses the user's jsonData field into DmsParameters with Jackson when isJsonFormat is true. If the Jackson readValue fails (malformed JSON or schema mismatch), the code logs the failure and throws a TaskException whose message is the raw Jackson exception message.

Source

Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-dms/src/main/java/org/apache/dolphinscheduler/plugin/task/dms/DmsTask.java:246

        }
    }

    /**
     * convert json parameters to dms parameters
     */
    public void convertJsonParameters() throws TaskException {
        // create a new parameter object using the json data if the json data is not empty
        if (parameters.getIsJsonFormat() && parameters.getJsonData() != null) {
            String jsonData = ParameterUtils.convertParameterPlaceholders(parameters.getJsonData(),
                    ParameterUtils.convert(taskExecutionContext.getPrepareParamsMap()));

            boolean isRestartTask = parameters.getIsRestartTask();
            try {
                parameters = objectMapper.readValue(jsonData, DmsParameters.class);
                parameters.setIsRestartTask(isRestartTask);
            } catch (Exception e) {
                log.error("Failed to convert json data to DmsParameters object.", e);
                throw new TaskException(e.getMessage());
            }
        }
    }

    @Override
    public DmsParameters getParameters() {
        return parameters;
    }

    @Override
    public void cancelApplication() {
        dmsHook.stopReplicationTask();
    }

}

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Validate jsonData in a JSON linter / the task's JSON editor before saving the workflow.
  2. Match field names to the mapper's naming strategy (UpperCamelCaseStrategy) or fix to current DmsParameters schema.
  3. Check for parameter placeholders (e.g. ${var}) whose substituted values break JSON escaping; escape quotes in the placeholder value.
  4. Read the thrown message — it names the Jackson parse location (line/column) — and fix that exact spot.

Example fix

// before
"jsonData": "{ReplicationTaskArn: 'arn:...'}" // invalid JSON
// after
"jsonData": "{\"ReplicationTaskArn\": \"arn:aws:dms:...\"}"
Defensive patterns

Strategy: validation

Validate before calling

// validate jsonData before enabling isJsonFormat
ObjectMapper m = JsonMapper.builder().propertyNamingStrategy(new PropertyNamingStrategy.UpperCamelCaseStrategy()).build();
m.readTree(jsonData); // throws if malformed
DmsParameters p = m.readValue(jsonData, DmsParameters.class); // throws if schema mismatch

Try / catch

try {
    convertJsonParameters();
} catch (TaskException e) {
    log.error("jsonData invalid, fix JSON syntax/field names: {}", e.getMessage());
}

Prevention

When it happens

Trigger: Called by initDmsHook during task init when parameters.getIsJsonFormat() is true and jsonData != null; objectMapper.readValue(jsonData, DmsParameters.class) throws JsonProcessingException because jsonData is not valid JSON or does not fit UpperCamelCaseStrategy DmsParameters fields.

Common situations: Hand-written jsonData with a trailing comma or single quotes; field names in snake_case when the mapper expects UpperCamelCase; using placeholder substitution that produced broken JSON; DmsParameters schema changed between DolphinScheduler versions making old jsonData incompatible.

Understand the failure class

Background: JSON parse error: "Unexpected token" / "not valid JSON" / "failed to parse" — what JSON parsers are really complaining about — this error's family across 45 libraries.

Related errors


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/feb5e518c81ac304. Report an issue: GitHub.