apache/dolphinscheduler · error · TaskException

dvc task params is not valid

Error message

dvc task params is not valid

What it means

DvcTask.init parses taskParams into DvcParameters via JSONUtils and immediately validates them. If parsing yields null (bad/empty JSON) or DvcParameters.checkParameters() returns false (required fields like dvcTaskType, dvcRepository missing), a TaskException 'dvc task params is not valid' is thrown.

Source

Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-dvc/src/main/java/org/apache/dolphinscheduler/plugin/task/dvc/DvcTask.java:57

public class DvcTask extends AbstractTask {

    private DvcParameters parameters;

    private final ShellCommandExecutor shellCommandExecutor;

    public DvcTask(TaskExecutionContext taskExecutionContext) {
        super(taskExecutionContext);
        this.shellCommandExecutor = new ShellCommandExecutor(taskExecutionContext);
    }

    @Override
    public void init() {

        parameters = JSONUtils.parseObject(taskRequest.getTaskParams(), DvcParameters.class);
        log.info("Initialize dvc task params {}", JSONUtils.toPrettyJsonString(parameters));

        if (parameters == null || !parameters.checkParameters()) {
            throw new TaskException("dvc task params is not valid");
        }
    }

    @Override
    public void handle(TaskCallBack taskCallBack) throws TaskException {
        try {
            // construct process
            IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()
                    .appendScript(buildCommand());
            TaskResponse commandExecuteResult = shellCommandExecutor.run(shellActuatorBuilder, taskCallBack);
            setExitStatusCode(commandExecuteResult.getExitStatusCode());
            setProcessId(commandExecuteResult.getProcessId());
            parameters.dealOutParam(shellCommandExecutor.getTaskOutputParams());
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            log.error("The current DvcTask has been interrupted", e);
            setExitStatusCode(EXIT_CODE_FAILURE);
            throw new TaskException("The current DvcTask has been interrupted", e);

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Open the DVC task node in the UI and fill all required fields (task type, DVC repository, data path/location, version, or store URL for init).
  2. Check checkParameters() in DvcParameters to see exactly which fields it requires, then supply them.
  3. Validate the taskParams JSON stored for the task instance is non-empty and parseable.
  4. If the form was hand-edited, regenerate it via the UI to get the correct parameter structure.

Example fix

// before: missing dvcTaskType
{"localParams":[],"resourceList":[]}
// after
{"dvcTaskType":"UPLOAD","dvcRepository":"https://github.com/x/repo.git","dvcLoadSaveDataPath":"./data","dvcDataLocation":"s3://bucket/data","dvcVersion":"v1.0","localParams":[],"resourceList":[]}
Defensive patterns

Strategy: validation

Validate before calling

DvcParameters p = JSONUtils.parseObject(taskParams, DvcParameters.class);
if (p == null || !p.checkParameters()) {
    throw new IllegalArgumentException("DVC params missing required fields (dvcTaskType, dvcRepository, ...)");
}

Type guard

boolean dvcParamsValid(String json) {
    DvcParameters p = JSONUtils.parseObject(json, DvcParameters.class);
    return p != null && p.checkParameters();
}

Try / catch

try {
    task.init();
} catch (TaskException e) {
    // surface a user-facing 'fix the DVC node form' message
}

Prevention

When it happens

Trigger: init() called during task lifecycle with taskParams that deserialize to null or fail DvcParameters.checkParameters() — missing dvcTaskType, dvcRepository, dvcLoadSaveDataPath/dvcDataLocation/dvcVersion (for upload/download) or dvcStoreUrl (for init).

Common situations: Workflow saved with empty DVC node form; wrong task type selected so required fields were never filled; UI plugin/form mismatch after upgrading DolphinScheduler; hand-edited workflow JSON dropping required fields.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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