{"record":{"id":"85e8bc8f10de1197","repo":"apache/dolphinscheduler","slug":"sagemaker-task-params-is-empty","errorCode":null,"errorMessage":"Sagemaker task params is empty","messagePattern":"Sagemaker task params is empty","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":92,"sourceCode":"    private SagemakerTaskExecutionContext sagemakerTaskExecutionContext;\n    private TaskExecutionContext taskExecutionContext;\n\n    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","sourceCodeStart":74,"sourceCodeEnd":110,"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#L74-L110","documentation":"SagemakerTask.init parses taskRequest.getTaskParams() into SagemakerParameters with JSONUtils.parseObject; if the result is null (empty, missing, or unparseable params JSON) it throws SagemakerTaskException(\"Sagemaker task params is empty\"). The task cannot proceed without its parameter object.","triggerScenarios":"init() is called with taskParams that are null, an empty string, or JSON that fails to deserialize into SagemakerParameters, causing JSONUtils.parseObject to return null.","commonSituations":"Sagemaker task saved with no parameters; workflow definition JSON corrupted or hand-edited; upgrading from a version with different param field names so deserialization yields null; JSON syntax errors in taskParams.","solutions":["Open the Sagemaker task definition and re-enter/save the parameters so taskParams is populated.","Inspect the task's taskParams JSON in the database/workflow definition for emptiness or syntax errors.","Check server/plugin version consistency so param JSON field names match SagemakerParameters expectations.","Validate the JSON with a linter if the workflow was hand-edited, then re-import the workflow."],"exampleFix":"// before: empty params in task definition\n{\"sagemakerTaskParams\":null}\n// after: provide required params\n{\"sagemakerRequestJson\":\"{\\\"PipelineName\\\":\\\"my-pipeline\\\",...}\",\"resourceList\":[]}","handlingStrategy":"validation","validationCode":"SagemakerParameters p = JSONUtils.parseObject(taskParams, SagemakerParameters.class);\nif (p == null || !p.checkParameters()) {\n    throw new IllegalArgumentException(\"Sagemaker taskParams missing or invalid — check workflow definition JSON\");\n}","typeGuard":"boolean hasParams(SagemakerParameters p) { return p != null && p.checkParameters(); }","tryCatchPattern":"try {\n    sagemakerTask.init();\n} catch (SagemakerTaskException e) {\n    logger.error(\"Sagemaker params problem: {}. Dump taskParams for diagnosis\", e.getMessage());\n    throw e;\n}","preventionTips":["Fill in all Sagemaker task parameters in the UI before saving the workflow.","Validate taskParams JSON after any direct database/workflow-JSON edits.","Keep plugin versions consistent across master, worker, and UI to avoid deserialization drift."],"tags":["task-params","json","sagemaker","configuration"],"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"}