{"record":{"id":"1425eeb37b56a687","repo":"apache/dolphinscheduler","slug":"can-not-parse-sagemakerrequestjson","errorCode":null,"errorMessage":"can not parse SagemakerRequestJson ","messagePattern":"can not parse SagemakerRequestJson ","errorType":"exception","errorClass":"SagemakerTaskException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-sagemaker/src/main/java/org/apache/dolphinscheduler/plugin/task/sagemaker/SagemakerTask.java","lineNumber":169,"sourceCode":"                pipelineId = JSONUtils.parseObject(getAppIds(), PipelineUtils.PipelineId.class);\n            }\n        }\n        if (pipelineId == null) {\n            throw new TaskException(\"sagemaker applicationID is null\");\n        }\n    }\n\n    public StartPipelineExecutionRequest createStartPipelineRequest() throws SagemakerTaskException {\n\n        String requestJson = parameters.getSagemakerRequestJson();\n        requestJson = parseRequstJson(requestJson);\n\n        StartPipelineExecutionRequest startPipelineRequest;\n        try {\n            startPipelineRequest = objectMapper.readValue(requestJson, StartPipelineExecutionRequest.class);\n        } catch (Exception e) {\n            log.error(\"can not parse SagemakerRequestJson from json: {}\", requestJson);\n            throw new SagemakerTaskException(\"can not parse SagemakerRequestJson \", e);\n        }\n\n        log.info(\"Sagemaker task create StartPipelineRequest: {}\", startPipelineRequest);\n        return startPipelineRequest;\n    }\n\n    @Override\n    public SagemakerParameters getParameters() {\n        return parameters;\n    }\n\n    private String parseRequstJson(String requestJson) {\n        Map<String, Property> paramsMap = taskRequest.getPrepareParamsMap();\n        return ParameterUtils.convertParameterPlaceholders(requestJson, ParameterUtils.convert(paramsMap));\n    }\n\n    protected AmazonSageMaker createClient() {\n        Map<String, String> awsProperties = PropertyUtils.getByPrefix(\"aws.sagemaker.\", \"\");","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-sagemaker/src/main/java/org/apache/dolphinscheduler/plugin/task/sagemaker/SagemakerTask.java#L151-L187","documentation":"createStartPipelineRequest() deserializes parameters.getSagemakerRequestJson() into an AWS StartPipelineExecutionRequest with ObjectMapper; any parse failure is logged and rethrown as SagemakerTaskException(\"can not parse SagemakerRequestJson \"). It means the user-supplied request JSON is not valid for the AWS SDK model.","triggerScenarios":"objectMapper.readValue(requestJson, StartPipelineExecutionRequest.class) throws JsonProcessingException: the JSON is syntactically invalid, or fields don't match the SDK model (unknown fields fail only if FAIL_ON_UNKNOWN_PROPERTIES is on; wrong types always fail).","commonSituations":"Users paste AWS CLI-style JSON with comments or trailing commas, use camelCase from an old SDK doc, wrap the JSON in quotes accidentally, or the DS UI escapes the JSON incorrectly.","solutions":["Copy the logged 'requestJson' from the error line and validate it with a JSON linter (jq, jsonlint).","Compare the JSON against the AWS SDK's StartPipelineExecutionRequest schema — field names and types must match exactly.","Fix type errors (e.g. PipelineParameters as an array of {Name,Value} objects, not strings).","Re-paste the JSON into the task form carefully, ensuring the UI doesn't double-escape it, then save and re-run."],"exampleFix":"// before\n{\"PipelineName\":\"p\",\"PipelineParameters\":\"a,b\"} // string not accepted\n// after\n{\"PipelineName\":\"p\",\"PipelineParameters\":[{\"Name\":\"env\",\"Value\":\"prod\"}]}","handlingStrategy":"validation","validationCode":"// client-side pre-check of the request JSON\ntry {\n    new ObjectMapper().readValue(sagemakerRequestJson, StartPipelineExecutionRequest.class);\n} catch (JsonProcessingException e) {\n    throw new IllegalArgumentException(\"Fix sagemakerRequestJson: \" + e.getOriginalMessage());\n}","typeGuard":null,"tryCatchPattern":"try {\n    task.handle(null);\n} catch (SagemakerTaskException e) {\n    log.error(\"sagemakerRequestJson unparseable — validate with jq and AWS SDK schema\", e);\n}","preventionTips":["Validate the request JSON with jq/jsonlint before saving the task","Match AWS SDK field names and types exactly (PipelineParameters is an array of Name/Value objects)","Avoid comments, trailing commas, and double-escaping in the UI JSON field"],"tags":["sagemaker","json","deserialization"],"backgroundTag":"json-unmarshal-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"}