{"record":{"id":"b236225860f15fe4","repo":"apache/dolphinscheduler","slug":"dms-task-create-replication-task-error","errorCode":null,"errorMessage":"DMS task create replication task error","messagePattern":"DMS task create replication task error","errorType":"exception","errorClass":"TaskException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-dms/src/main/java/org/apache/dolphinscheduler/plugin/task/dms/DmsTask.java","lineNumber":147,"sourceCode":"        }\n        if (appId == null) {\n            throw new TaskException(\"DMS applicationID is null\");\n        }\n    }\n\n    public int checkCreateReplicationTask() throws TaskException {\n\n        // if IsRestartTask, return success, do not create replication task\n        if (parameters.getIsRestartTask()) {\n            return TaskConstants.EXIT_CODE_SUCCESS;\n        }\n\n        // if not IsRestartTask, create replication task\n        Boolean isCreateSuccessfully;\n        try {\n            isCreateSuccessfully = dmsHook.createReplicationTask();\n        } catch (Exception e) {\n            throw new TaskException(\"DMS task create replication task error\", e);\n        }\n\n        // if create replication task successfully, return EXIT_CODE_SUCCESS, else return EXIT_CODE_FAILURE\n        if (isCreateSuccessfully) {\n            return TaskConstants.EXIT_CODE_SUCCESS;\n        } else {\n            return TaskConstants.EXIT_CODE_FAILURE;\n        }\n    }\n\n    /**\n     * start replication task\n     *\n     * @return\n     * @throws TaskException\n     */\n    public int startReplicationTask() {\n","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-dms/src/main/java/org/apache/dolphinscheduler/plugin/task/dms/DmsTask.java#L129-L165","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the wrapped cause (e) in the log — it carries the AWS error code and message; fix the reported DMS issue first.","Validate endpoint connectivity (Test Connection in DMS console) and replication instance availability before running the task.","Check AWS credentials/IAM policy for dms:CreateReplicationTask and related permissions.","Validate jsonData/table mappings JSON syntax if isJsonFormat is enabled."],"exampleFix":"// before: wrong table-mappings JSON causes CreateReplicationTask to throw\n\"jsonData\": \"{\\\"rules\\\": }\"\n// after\n\"jsonData\": \"{\\\"rules\\\":[{\\\"rule-type\\\":\\\"selection\\\",...}]}\"","handlingStrategy":"try-catch","validationCode":"// pre-validate AWS-side prerequisites before submitting\n// 1) endpoint test connection, 2) replication instance status AVAILABLE,\n// 3) table-mappings JSON parses: new ObjectMapper().readTree(tableMappingsJson)","typeGuard":null,"tryCatchPattern":"try {\n    submitApplication();\n} catch (TaskException e) {\n    Throwable cause = e.getCause();\n    if (cause instanceof AmazonServiceException awsEx) {\n        // switch on awsEx.getErrorCode() (AccessDenied, InvalidParameterCombination...)\n    }\n}","preventionTips":["Run DMS 'Test connection' on source/target endpoints before scheduling.","Keep replication instances in AVAILABLE state before task runs.","Validate table mappings JSON in the workflow editor.","Scope IAM policy to dms:CreateReplicationTask and related actions."],"tags":["aws","dms","api-error","task-creation","iam"],"backgroundTag":"api-request-failed","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}