{"record":{"id":"9cb6178e7d0fd485","repo":"apache/dolphinscheduler","slug":"sell-task-params-is-not-valid","errorCode":null,"errorMessage":"sell task params is not valid","messagePattern":"sell task params is not valid","errorType":"validation","errorClass":"TaskException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/main/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteShellTask.java","lineNumber":82,"sourceCode":"     * constructor\n     *\n     * @param taskExecutionContext taskExecutionContext\n     */\n    public RemoteShellTask(TaskExecutionContext taskExecutionContext) {\n        super(taskExecutionContext);\n\n        this.taskExecutionContext = taskExecutionContext;\n    }\n\n    @Override\n    public void init() {\n        log.info(\"shell task params {}\", taskExecutionContext.getTaskParams());\n\n        remoteShellParameters =\n                JSONUtils.parseObject(taskExecutionContext.getTaskParams(), RemoteShellParameters.class);\n\n        if (!remoteShellParameters.checkParameters()) {\n            throw new TaskException(\"sell task params is not valid\");\n        }\n\n        taskId = taskExecutionContext.getAppIds();\n        if (taskId == null) {\n            taskId = TASK_ID_PREFIX + taskExecutionContext.getTaskInstanceId();\n        }\n        setAppIds(taskId);\n        taskExecutionContext.setAppIds(taskId);\n\n        initRemoteExecutor();\n    }\n\n    @Override\n    public void handle(TaskCallBack taskCallBack) throws TaskException {\n        // add task close method to release resource\n        try (RemoteExecutor executor = remoteExecutor) {\n            // construct process\n            String localFile = buildCommand();","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/main/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteShellTask.java#L64-L100","documentation":"RemoteShellTask.init parses taskParams into RemoteShellParameters and calls checkParameters(); if validation fails it throws TaskException(\"sell task params is not valid\") (a typo for 'shell'). It indicates the task definition's params JSON is missing mandatory fields required by RemoteShellParameters.","triggerScenarios":"Task init() runs and remoteShellParameters.checkParameters() returns false — typically when rawScript is empty/null or other required RemoteShellParameters fields are absent in taskParams.","commonSituations":"Task was saved with an empty script; workflow JSON hand-edited and a required param dropped; plugin/UI version mismatch producing params the checker rejects; JSON parsed to an object with all-null fields.","solutions":["Open the task definition and ensure rawScript (and other required fields) are non-empty; re-save the task.","Log/inspect taskExecutionContext.getTaskParams() to see exactly which field is missing (it's logged at info before the check).","Fix malformed hand-edited workflow JSON and re-import the workflow.","Align plugin version between master/worker/UI so param serialization matches checkParameters() expectations."],"exampleFix":"// before: empty script in taskParams\n{\"localParams\":[],\"rawScript\":\"\",\"resourceList\":[]}\n// after: provide the script\n{\"localParams\":[],\"rawScript\":\"echo hello\",\"resourceList\":[]}","handlingStrategy":"validation","validationCode":"RemoteShellParameters p = JSONUtils.parseObject(taskParams, RemoteShellParameters.class);\nif (p == null || !p.checkParameters()) {\n    throw new IllegalArgumentException(\"Invalid remote shell params: rawScript must not be empty\");\n}","typeGuard":"boolean hasValidParams(RemoteShellParameters p) { return p != null && p.checkParameters(); }","tryCatchPattern":"try {\n    task.init();\n} catch (TaskException e) {\n    if (e.getMessage().contains(\"not valid\")) {\n        logger.error(\"Task params failed checkParameters(): inspect taskParams JSON for empty rawScript\");\n    }\n    throw e;\n}","preventionTips":["Never save remote-shell tasks with an empty rawScript; the UI enforces it — don't bypass via API.","Avoid hand-editing workflow JSON; re-export from the UI after edits.","Keep master/worker/plugin versions aligned."],"tags":["task-params","validation","remote-shell","configuration"],"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-14T00:17:10.932Z"}