apache/dolphinscheduler · error · TaskException

DMS task create replication task error

Error message

DMS task create replication task error

What it means

checkCreateReplicationTask calls dmsHook.createReplicationTask(), which invokes the AWS DMS CreateReplicationTask API. Any exception thrown by the AWS SDK / hook is wrapped as TaskException 'DMS task create replication task error' with the original exception as cause.

Source

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

        }
        if (appId == null) {
            throw new TaskException("DMS applicationID is null");
        }
    }

    public int checkCreateReplicationTask() throws TaskException {

        // if IsRestartTask, return success, do not create replication task
        if (parameters.getIsRestartTask()) {
            return TaskConstants.EXIT_CODE_SUCCESS;
        }

        // if not IsRestartTask, create replication task
        Boolean isCreateSuccessfully;
        try {
            isCreateSuccessfully = dmsHook.createReplicationTask();
        } catch (Exception e) {
            throw new TaskException("DMS task create replication task error", e);
        }

        // if create replication task successfully, return EXIT_CODE_SUCCESS, else return EXIT_CODE_FAILURE
        if (isCreateSuccessfully) {
            return TaskConstants.EXIT_CODE_SUCCESS;
        } else {
            return TaskConstants.EXIT_CODE_FAILURE;
        }
    }

    /**
     * start replication task
     *
     * @return
     * @throws TaskException
     */
    public int startReplicationTask() {

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Read the wrapped cause (e) in the log — it carries the AWS error code and message; fix the reported DMS issue first.
  2. Validate endpoint connectivity (Test Connection in DMS console) and replication instance availability before running the task.
  3. Check AWS credentials/IAM policy for dms:CreateReplicationTask and related permissions.
  4. Validate jsonData/table mappings JSON syntax if isJsonFormat is enabled.

Example fix

// before: wrong table-mappings JSON causes CreateReplicationTask to throw
"jsonData": "{\"rules\": }"
// after
"jsonData": "{\"rules\":[{\"rule-type\":\"selection\",...}]}"
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-validate AWS-side prerequisites before submitting
// 1) endpoint test connection, 2) replication instance status AVAILABLE,
// 3) table-mappings JSON parses: new ObjectMapper().readTree(tableMappingsJson)

Try / catch

try {
    submitApplication();
} catch (TaskException e) {
    Throwable cause = e.getCause();
    if (cause instanceof AmazonServiceException awsEx) {
        // switch on awsEx.getErrorCode() (AccessDenied, InvalidParameterCombination...)
    }
}

Prevention

When it happens

Trigger: Called from submitApplication when IsRestartTask is false; the DmsHook.createReplicationTask() call throws — AWS SDK exception, invalid parameters (bad endpoints, replication instance ARN, table mappings), missing IAM permissions, or resource limits.

Common situations: Invalid source/target endpoint settings or unreachable databases; replication instance not available; invalid JSON table mappings; expired/insufficient AWS credentials (AccessDenied); quota exceeded for replication tasks; typo in migrationType or startReplicationTaskType.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


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