apache/dolphinscheduler · error · TaskException

DMS task failed to track

Error message

DMS task failed to track

What it means

DmsTask.trackApplicationStatus polls AWS DMS to see whether the replication task finished successfully (dmsHook.checkFinishedReplicationTask). If the check returns false — the replication task did not reach a successfully-finished state — a TaskException with this message is thrown so the worker marks the task failed.

Source

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

    }

    @Override
    public void trackApplicationStatus() {
        initAppId();
        dmsHook.setReplicationTaskArn(appId.getReplicationTaskArn());
        // if CdcStopPosition is not set, the task will not continue to check the running status
        if (isStopTaskWhenCdc()) {
            log.info(
                    "This is a cdc task and cdcStopPosition is not set, the task will not continue to check the running status");
            exitStatusCode = TaskConstants.EXIT_CODE_SUCCESS;
            return;
        }

        Boolean isFinishedSuccessfully = dmsHook.checkFinishedReplicationTask();
        if (isFinishedSuccessfully) {
            exitStatusCode = TaskConstants.EXIT_CODE_SUCCESS;
        } else {
            throw new TaskException("DMS task failed to track");
        }
    }

    /**
     * init DMS remote AppId if null
     */
    private void initAppId() {
        if (appId == null) {
            if (StringUtils.isNotEmpty(getAppIds())) {
                appId = JSONUtils.parseObject(getAppIds(), DmsHook.ApplicationIds.class);
            }
        }
        if (appId == null) {
            throw new TaskException("DMS applicationID is null");
        }
    }

    public int checkCreateReplicationTask() throws TaskException {

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Check the replication task in the AWS DMS console for its actual status and failure reason, fix the underlying replication error (endpoints, table mappings, network).
  2. If running a CDC task, verify cdcStopPosition is set to a valid, reachable position or remove it so tracking is skipped (isStopTaskWhenCdc path).
  3. Verify the IAM credentials/role used by DmsHook have dms:DescribeReplicationTasks and related permissions so status checks report accurately.
  4. Re-run the task with IsRestartTask if the underlying data is consistent and the task can be restarted.

Example fix

// before: task keeps polling a CDC position that never completes
"cdcStopPosition": "mysql-bin-changelog.000000:never"
// after: use a real binlog position or omit it to skip status tracking
"cdcStopPosition": "mysql-bin-changelog.012345:0010" || omit
Defensive patterns

Strategy: try-catch

Validate before calling

// before scheduling tracking, ensure the replication task finished successfully
ReplicationTask t = dmsHook.describeReplicationTasks();
if (!"COMPLETED".equalsIgnoreCase(t.getStatus()) && !("cdc".contains(t.getMigrationType().toLowerCase()) && params.getCdcStopPosition() != null)) {
    throw new IllegalStateException("Replication not finished: " + t.getStatus());
}

Try / catch

try {
    trackApplicationStatus();
} catch (TaskException e) {
    // inspect DMS task status via describeReplicationTasks, alert, then retry or fail workflow
}

Prevention

When it happens

Trigger: Called during task tracking: the DMS replication task exists and has an ARN, but checkFinishedReplicationTask() returns false, i.e. the replication task status is not 'finished/completed' (it failed, stopped, or is still running without reaching the success state).

Common situations: The DMS replication task actually failed in AWS (source/target endpoint connectivity, table errors, full-load errors); cdcStopPosition was set to a position that is never reached so the task never finishes; insufficient DMS IAM permissions causing describe/modify calls to report non-success; the replication task was manually stopped in the AWS console.

Related errors


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