{"record":{"id":"5b07e2c3f256fab2","repo":"apache/dolphinscheduler","slug":"ds-emr-addjobflowstepstask-only-support-one-step","errorCode":null,"errorMessage":"ds emr addJobFlowStepsTask only support one step","messagePattern":"ds emr addJobFlowStepsTask only support one step","errorType":"exception","errorClass":"EmrTaskException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-emr/src/main/java/org/apache/dolphinscheduler/plugin/task/emr/EmrAddStepsTask.java","lineNumber":146,"sourceCode":"\n        final AddJobFlowStepsRequest addJobFlowStepsRequest;\n        String jobStepDefineJson = null;\n        try {\n            jobStepDefineJson = ParameterUtils.convertParameterPlaceholders(\n                    emrParameters.getStepsDefineJson(),\n                    ParameterUtils.convert(taskExecutionContext.getPrepareParamsMap()));\n            addJobFlowStepsRequest =\n                    objectMapper.readValue(jobStepDefineJson, AddJobFlowStepsRequest.class);\n        } catch (JsonProcessingException e) {\n            throw new EmrTaskException(\"can not parse AddJobFlowStepsRequest from json: \" + jobStepDefineJson, e);\n        }\n\n        // When a single task definition is associated with multiple steps, the state tracking will have high\n        // complexity.\n        // Therefore, A task definition only supports the association of a single step, which can better ensure the\n        // reliability of the task state.\n        if (addJobFlowStepsRequest.getSteps().size() > 1) {\n            throw new EmrTaskException(\"ds emr addJobFlowStepsTask only support one step\");\n        }\n\n        return addJobFlowStepsRequest;\n    }\n\n    /**\n     * calculate task exitStatusCode\n     *\n     * @param stepStatus aws emr execution status details of the cluster step.\n     * @return exitStatusCode\n     */\n    private int calculateExitStatusCode(StepStatus stepStatus) {\n        if (stepStatus == null) {\n            return TaskConstants.EXIT_CODE_FAILURE;\n        } else {\n            String state = stepStatus.getState();\n            StepState stepState = StepState.valueOf(state);\n            switch (stepState) {","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-emr/src/main/java/org/apache/dolphinscheduler/plugin/task/emr/EmrAddStepsTask.java#L128-L164","documentation":"A semantic validation guard after parsing stepsDefineJson: DolphinScheduler only orchestrates a single EMR step per task, so an AddJobFlowStepsRequest whose Steps list contains more than one step is rejected outright. The offending input is the stepsDefineJson containing multiple step entries; it is a usage error, not an AWS failure.","triggerScenarios":"Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-emr/src/main/java/org/apache/dolphinscheduler/plugin/task/emr/EmrAddStepsTask.java:146 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce stepsDefineJson to exactly one entry in the Steps array","Chain multiple EMR AddSteps task nodes in the workflow instead of embedding several steps in one task"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}