{"record":{"id":"d116932a2b74e56f","repo":"apache/dolphinscheduler","slug":"can-not-parse-runjobflowrequest-from-json-jobfl","errorCode":null,"errorMessage":"can not parse RunJobFlowRequest from json: ${jobFlowDefineJson}","messagePattern":"can not parse RunJobFlowRequest 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/EmrJobFlowTask.java","lineNumber":131,"sourceCode":"        }\n    }\n\n    /**\n     * parse json string to RunJobFlowRequest\n     *\n     * @return RunJobFlowRequest\n     */\n    protected RunJobFlowRequest createRunJobFlowRequest() {\n\n        final RunJobFlowRequest runJobFlowRequest;\n        String jobFlowDefineJson = null;\n        try {\n            jobFlowDefineJson = ParameterUtils.convertParameterPlaceholders(\n                    emrParameters.getJobFlowDefineJson(),\n                    ParameterUtils.convert(taskExecutionContext.getPrepareParamsMap()));\n            runJobFlowRequest = objectMapper.readValue(jobFlowDefineJson, RunJobFlowRequest.class);\n        } catch (JsonProcessingException e) {\n            throw new EmrTaskException(\"can not parse RunJobFlowRequest from json: \" + jobFlowDefineJson, e);\n        }\n\n        return runJobFlowRequest;\n    }\n\n    /**\n     * calculate task exitStatusCode\n     *\n     * @param clusterStatus aws emr cluster status\n     * @return exitStatusCode\n     */\n    private int calculateExitStatusCode(ClusterStatus clusterStatus) {\n        if (clusterStatus == null) {\n            return TaskConstants.EXIT_CODE_FAILURE;\n        } else {\n            String state = clusterStatus.getState();\n            ClusterStateChangeReason stateChangeReason = clusterStatus.getStateChangeReason();\n            ClusterState clusterState = ClusterState.valueOf(state);","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-emr/src/main/java/org/apache/dolphinscheduler/plugin/task/emr/EmrJobFlowTask.java#L113-L149","documentation":"createRunJobFlowRequest caught JsonProcessingException: after placeholder substitution, jobFlowDefineJson could not be deserialized into AWS SDK's RunJobFlowRequest — invalid JSON syntax or a structure not matching the request schema (wrong Name/Instances/Steps fields). The offending input is the jobFlowDefineJson task parameter; no AWS call has been made yet.","triggerScenarios":"Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-emr/src/main/java/org/apache/dolphinscheduler/plugin/task/emr/EmrJobFlowTask.java:131 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Validate jobFlowDefineJson against the RunJobFlowRequest schema (Applications, Instances, JobFlowRole, ServiceRole, Steps)","Check placeholder substitution output — unexpanded ${var} tokens or broken quoting cause parse failure","Round-trip test the JSON in the task definition before execution"],"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"}