apache/dolphinscheduler · error · TaskException

sell task params is not valid

Error message

sell task params is not valid

What it means

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.

Source

Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-remoteshell/src/main/java/org/apache/dolphinscheduler/plugin/task/remoteshell/RemoteShellTask.java:82

     * constructor
     *
     * @param taskExecutionContext taskExecutionContext
     */
    public RemoteShellTask(TaskExecutionContext taskExecutionContext) {
        super(taskExecutionContext);

        this.taskExecutionContext = taskExecutionContext;
    }

    @Override
    public void init() {
        log.info("shell task params {}", taskExecutionContext.getTaskParams());

        remoteShellParameters =
                JSONUtils.parseObject(taskExecutionContext.getTaskParams(), RemoteShellParameters.class);

        if (!remoteShellParameters.checkParameters()) {
            throw new TaskException("sell task params is not valid");
        }

        taskId = taskExecutionContext.getAppIds();
        if (taskId == null) {
            taskId = TASK_ID_PREFIX + taskExecutionContext.getTaskInstanceId();
        }
        setAppIds(taskId);
        taskExecutionContext.setAppIds(taskId);

        initRemoteExecutor();
    }

    @Override
    public void handle(TaskCallBack taskCallBack) throws TaskException {
        // add task close method to release resource
        try (RemoteExecutor executor = remoteExecutor) {
            // construct process
            String localFile = buildCommand();

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Open the task definition and ensure rawScript (and other required fields) are non-empty; re-save the task.
  2. Log/inspect taskExecutionContext.getTaskParams() to see exactly which field is missing (it's logged at info before the check).
  3. Fix malformed hand-edited workflow JSON and re-import the workflow.
  4. Align plugin version between master/worker/UI so param serialization matches checkParameters() expectations.

Example fix

// before: empty script in taskParams
{"localParams":[],"rawScript":"","resourceList":[]}
// after: provide the script
{"localParams":[],"rawScript":"echo hello","resourceList":[]}
Defensive patterns

Strategy: validation

Validate before calling

RemoteShellParameters p = JSONUtils.parseObject(taskParams, RemoteShellParameters.class);
if (p == null || !p.checkParameters()) {
    throw new IllegalArgumentException("Invalid remote shell params: rawScript must not be empty");
}

Type guard

boolean hasValidParams(RemoteShellParameters p) { return p != null && p.checkParameters(); }

Try / catch

try {
    task.init();
} catch (TaskException e) {
    if (e.getMessage().contains("not valid")) {
        logger.error("Task params failed checkParameters(): inspect taskParams JSON for empty rawScript");
    }
    throw e;
}

Prevention

When it happens

Trigger: Task init() runs and remoteShellParameters.checkParameters() returns false — typically when rawScript is empty/null or other required RemoteShellParameters fields are absent in taskParams.

Common situations: 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.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/9cb6178e7d0fd485. Report an issue: GitHub.