apache/dolphinscheduler · error · TaskException

DMS task init error

Error message

DMS task init error

What it means

initDmsHook builds a DmsHook and copies DmsParameters properties onto it with commons-beanutils BeanUtils.copyProperties. If the reflective copy throws (or its nested InvocationTargetException occurs) a TaskException 'DMS task init error' is thrown during task init.

Source

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

     * @return true if stop task when cdc type and cdcStopPosition is not set, else return false
     */
    public Boolean isStopTaskWhenCdc() {
        ReplicationTask replicationTask = dmsHook.describeReplicationTasks();
        String migrationType = replicationTask.getMigrationType();
        return migrationType.contains("cdc") && parameters.getCdcStopPosition() == null;
    }

    /**
     * init dms hook
     */
    public void initDmsHook() throws TaskException {
        convertJsonParameters();

        dmsHook = new DmsHook();
        try {
            BeanUtils.copyProperties(dmsHook, parameters);
        } catch (Exception e) {
            throw new TaskException("DMS task init error", e);
        }

        if (!StringUtils.isNotEmpty(parameters.getStartReplicationTaskType())) {
            if (parameters.getIsRestartTask()) {
                dmsHook.setStartReplicationTaskType(DmsHook.START_TYPE.RELOAD_TARGET);
            } else {
                dmsHook.setStartReplicationTaskType(DmsHook.START_TYPE.START_REPLICATION);
            }
        }
    }

    /**
     * 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(),

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Check the 'Caused by' in the worker log for the real reflection/setter error and fix the offending parameter or DmsHook setter.
  2. Compare DmsParameters fields with DmsHook setters — ensure every copied property has a matching compatible setter.
  3. Pin a compatible commons-beanutils version in the plugin pom.xml to avoid classpath conflicts with other plugins.
  4. If a customjsonData path was used, verify the parsed DmsParameters contain only valid values.

Example fix

// before: DmsHook has no setter for new field -> copyProperties throws
private String newOption; // in DmsParameters, no setter in DmsHook
// after: add a matching setter in DmsHook
public void setNewOption(String newOption) { this.newOption = newOption; }
Defensive patterns

Strategy: try-catch

Try / catch

try {
    init();
} catch (TaskException e) {
    log.error("DMS init failed", e.getCause()); // cause holds the BeanUtils reflection error
}

Prevention

When it happens

Trigger: BeanUtils.copyProperties(dmsHook, parameters) throws inside initDmsHook — e.g. a property type mismatch between DmsParameters and DmsHook, an exception thrown by a DmsHook setter, or reflection/NoSuchMethod issues after a version change.

Common situations: A new field added to DmsParameters with no compatible setter in DmsHook; incompatible commons-beanutils version on the classpath (plugin classloader is shared); a DmsHook setter validating and rejecting a parameter value.

Related errors


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