{"record":{"id":"3ef632c9649212db","repo":"apache/dolphinscheduler","slug":"can-not-parse-addjobflowstepsrequest-from-json","errorCode":null,"errorMessage":"can not parse AddJobFlowStepsRequest from json: ${jobStepDefineJson}","messagePattern":"can not parse AddJobFlowStepsRequest from json: (.+?)","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":138,"sourceCode":"    }\n\n    /**\n     * parse json string to AddJobFlowStepsRequest\n     *\n     * @return AddJobFlowStepsRequest\n     */\n    protected AddJobFlowStepsRequest createAddJobFlowStepsRequest() {\n\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","sourceCodeStart":120,"sourceCodeEnd":156,"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#L120-L156","documentation":"createAddJobFlowStepsRequest caught JsonProcessingException: after placeholder substitution, the stepsDefineJson string could not be deserialized into AWS SDK's AddJobFlowStepsRequest — the JSON is syntactically invalid or does not match the request schema (wrong Steps array shape, bad instance config). The offending input is the stepsDefineJson parameter; nothing has been submitted to EMR yet.","triggerScenarios":"Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-emr/src/main/java/org/apache/dolphinscheduler/plugin/task/emr/EmrAddStepsTask.java:138 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Validate stepsDefineJson against the AddJobFlowStepsRequest schema (Steps[], Name, ActionOnFailure, HadoopJarStep)","Check that placeholder substitution did not leave unexpanded ${var} tokens or break quoting","Test the JSON with a schema validator or a local objectMapper round-trip before saving the task"],"exampleFix":null,"handlingStrategy":"try-catch","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"}