{"record":{"id":"4959357ae90d21e2","repo":"apache/dolphinscheduler","slug":"aliyun-serverless-spark-task-parameters-are-not-va","errorCode":null,"errorMessage":"Aliyun-Serverless-Spark task parameters are not valid!","messagePattern":"Aliyun-Serverless-Spark task parameters are not valid!","errorType":"exception","errorClass":"AliyunServerlessSparkTaskException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-aliyunserverlessspark/src/main/java/org/apache/dolphinscheduler/plugin/task/aliyunserverlessspark/AliyunServerlessSparkTask.java","lineNumber":100,"sourceCode":"\n    private String regionId;\n\n    private String endpoint;\n\n    private RetryUtils.RetryPolicy retryPolicy = new RetryUtils.RetryPolicy(10, 1000L);\n\n    protected AliyunServerlessSparkTask(TaskExecutionContext taskExecutionContext) {\n        super(taskExecutionContext);\n        this.taskExecutionContext = taskExecutionContext;\n    }\n\n    @Override\n    public void init() {\n        final String taskParams = taskExecutionContext.getTaskParams();\n        aliyunServerlessSparkParameters = JSONUtils.parseObject(taskParams, AliyunServerlessSparkParameters.class);\n        log.info(\"aliyunServerlessSparkParameters - {}\", aliyunServerlessSparkParameters);\n        if (this.aliyunServerlessSparkParameters == null || !this.aliyunServerlessSparkParameters.checkParameters()) {\n            throw new AliyunServerlessSparkTaskException(\"Aliyun-Serverless-Spark task parameters are not valid!\");\n        }\n\n        ResourceParametersHelper resourceParametersHelper = taskExecutionContext.getResourceParametersHelper();\n        DataSourceParameters dataSourceParameters = (DataSourceParameters) resourceParametersHelper\n                .getResourceParameters(ResourceType.DATASOURCE, aliyunServerlessSparkParameters.getDatasource());\n        aliyunServerlessSparkConnectionParam = (AliyunServerlessSparkConnectionParam) DataSourceUtils\n                .buildConnectionParams(\n                        DbType.valueOf(aliyunServerlessSparkParameters.getType()),\n                        dataSourceParameters.getConnectionParams());\n\n        accessKeyId = aliyunServerlessSparkConnectionParam.getAccessKeyId();\n        accessKeySecret = aliyunServerlessSparkConnectionParam.getAccessKeySecret();\n        regionId = aliyunServerlessSparkConnectionParam.getRegionId();\n        endpoint = aliyunServerlessSparkConnectionParam.getEndpoint();\n\n        try {\n            aliyunServerlessSparkClient =\n                    buildAliyunServerlessSparkClient(accessKeyId, accessKeySecret, regionId, endpoint);","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-aliyunserverlessspark/src/main/java/org/apache/dolphinscheduler/plugin/task/aliyunserverlessspark/AliyunServerlessSparkTask.java#L82-L118","documentation":"AliyunServerlessSparkTask.init parses taskParams into AliyunServerlessSparkParameters and validates them via checkParameters(); if parsing yields null or validation fails, it throws AliyunServerlessSparkTaskException indicating the task parameters are invalid. The task cannot run without a valid workspaceId/datasource/params.","triggerScenarios":"Task definition JSON whose taskParams are empty/malformed (JSONUtils.parseObject returns null) or missing required fields checked by checkParameters() (e.g. workspaceId, clusterId, jobTemplateId, datasource).","commonSituations":"User saved the Aliyun Serverless Spark task node without filling required fields; manual JSON edits breaking the params; upgrading DolphinScheduler where parameter schema changed so old params fail checkParameters.","solutions":["Open the task definition in the UI and fill all required Aliyun Serverless Spark parameters","Validate taskParams JSON parses into AliyunServerlessSparkParameters with workspaceId and other required fields set","Re-save/re-create the task node to regenerate a valid parameter payload"],"exampleFix":"// before\n{\"localParams\":[],\"resourceList\":[]}  // missing workspaceId\n// after\n{\"workspaceId\":\"w-xxxx\",\"datasource\":1,\"jobName\":\"etl\",\"localParams\":[],\"resourceList\":[]}","handlingStrategy":"validation","validationCode":"AliyunServerlessSparkParameters p = JSONUtils.parseObject(taskParams, AliyunServerlessSparkParameters.class);\nif (p == null || !p.checkParameters()) {\n    throw new IllegalArgumentException(\"Invalid Aliyun Serverless Spark task params: workspaceId and required fields must be set\");\n}","typeGuard":"boolean isValidParams(AliyunServerlessSparkParameters p) {\n    return p != null && p.checkParameters();\n}","tryCatchPattern":"try {\n    task.init();\n} catch (AliyunServerlessSparkTaskException e) {\n    log.error(\"Parameter validation failed: {}\", e.getMessage());\n    task.getTaskExecutionContext().setNeedFaultTolerance(false); // fail fast, no retry\n}","preventionTips":["Always fill all required fields on the Aliyun Serverless Spark task node in the UI","Keep taskParams JSON schema consistent across scheduler upgrades","Add a dry-run validation of taskParams before saving the workflow"],"tags":["aliyun","task-plugin","parameter-validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}