{"record":{"id":"bf2525ea259cd84c","repo":"apache/dolphinscheduler","slug":"sagemaker-task-params-is-not-valid","errorCode":null,"errorMessage":"Sagemaker task params is not valid","messagePattern":"Sagemaker task params is not valid","errorType":"validation","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":95,"sourceCode":"    public SagemakerTask(TaskExecutionContext taskExecutionContext) {\n        super(taskExecutionContext);\n        this.taskExecutionContext = taskExecutionContext;\n    }\n\n    @Override\n    public List<String> getApplicationIds() throws TaskException {\n        return Collections.emptyList();\n    }\n\n    @Override\n    public void init() {\n\n        parameters = JSONUtils.parseObject(taskRequest.getTaskParams(), SagemakerParameters.class);\n        if (parameters == null) {\n            throw new SagemakerTaskException(\"Sagemaker task params is empty\");\n        }\n        if (!parameters.checkParameters()) {\n            throw new SagemakerTaskException(\"Sagemaker task params is not valid\");\n        }\n        sagemakerTaskExecutionContext =\n                parameters.generateExtendedContext(taskExecutionContext.getResourceParametersHelper());\n        sagemakerConnectionParam =\n                (SagemakerConnectionParam) DataSourceUtils.buildConnectionParams(DbType.valueOf(parameters.getType()),\n                        sagemakerTaskExecutionContext.getConnectionParams());\n        parameters.setUsername(sagemakerConnectionParam.getUserName());\n        parameters.setPassword(sagemakerConnectionParam.getPassword());\n        parameters.setAwsRegion(sagemakerConnectionParam.getAwsRegion());\n        log.info(\"Initialize Sagemaker task params {}\", JSONUtils.toPrettyJsonString(parameters));\n\n        client = createClient();\n        utils = new PipelineUtils();\n    }\n\n    @Override\n    public void submitApplication() throws TaskException {\n        try {","sourceCodeStart":77,"sourceCodeEnd":113,"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#L77-L113","documentation":"SagemakerTask.init() parses the task's JSON params into SagemakerParameters and calls checkParameters(); when the validation fails it throws SagemakerTaskException with this message. It means required SageMaker task fields (e.g. sagemakerRequestJson, datasource type/connection) are missing or inconsistent, so the task cannot build a StartPipelineExecutionRequest.","triggerScenarios":"SagemakerParameters.checkParameters() returns false after JSONUtils.parseObject successfully deserialized the params — typically when sagemakerRequestJson is blank or the defined datasource type does not match a known DbType.","commonSituations":"Users leave the SageMaker request JSON empty in the task form, paste invalid JSON that serializes with null required fields, or switch task versions so older stored params no longer satisfy newer checkParameters() rules.","solutions":["Open the SageMaker task definition and fill in the required fields (sagemakerRequestJson, datasource) then save and re-run.","Validate the task params JSON locally: deserialize into SagemakerParameters and call checkParameters() to see what is missing.","Check server logs for the JSONUtils.parseObject result to distinguish 'params is empty' (parse produced null) from 'params is not valid'.","If params come from an older workflow, re-edit the task in the current DS version so defaults are regenerated."],"exampleFix":"// before: task saved with empty request json\n{\"localParams\":[],\"resourceList\":[],\"type\":\"AWS_SAGEMAKER\",\"sagemakerRequestJson\":\"\"}\n// after\n{\"localParams\":[],\"resourceList\":[],\"type\":\"AWS_SAGEMAKER\",\"sagemakerRequestJson\":\"{\\\"PipelineName\\\":\\\"my-pipeline\\\",\\\"ClientRequestToken\\\":\\\"abc\\\"}\"}","handlingStrategy":"validation","validationCode":"SagemakerParameters p = JSONUtils.parseObject(taskParams, SagemakerParameters.class);\nif (p == null || !p.checkParameters()) {\n    throw new IllegalStateException(\"SageMaker task params missing or invalid; check sagemakerRequestJson and datasource\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    task.init();\n} catch (SagemakerTaskException e) {\n    log.error(\"SageMaker params invalid, fix task definition\", e);\n    // mark task failed without retry\n}","preventionTips":["Always fill sagemakerRequestJson with valid, schema-complete JSON in the task form","Dry-run checkParameters() logic after upgrading DolphinScheduler","Avoid hand-editing task params in the DB"],"tags":["sagemaker","task-params","validation"],"backgroundTag":"invalid-config-value","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"}