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
- 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).
- If running a CDC task, verify cdcStopPosition is set to a valid, reachable position or remove it so tracking is skipped (isStopTaskWhenCdc path).
- Verify the IAM credentials/role used by DmsHook have dms:DescribeReplicationTasks and related permissions so status checks report accurately.
- 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
- Always set a reachable cdcStopPosition for CDC tasks that must be tracked to completion.
- Monitor DMS replication task status in AWS CloudWatch alongside the workflow.
- Verify endpoint test connections before full-load runs.
- Grant DMS read permissions to the credentials used by DmsHook.
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
- DMS applicationID is null
- Failed to create a ReplicationTask
- DMS task create replication task error
- remote.logging.s3.bucket.name is blank
- bucketName: <bucketName> is not exists, you need to create t
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/1d6f5a34a7fa4a41.
Report an issue: GitHub.