apache/dolphinscheduler · error · TaskException

Sqoop Task params is null

Error message

Sqoop Task params is null

What it means

SqoopTask.init() deserializes the task's taskParams JSON into SqoopParameters. If the JSON is null or cannot be parsed into a valid object, the task throws this TaskException because no Sqoop job can be built.

Source

Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-sqoop/src/main/java/org/apache/dolphinscheduler/plugin/task/sqoop/SqoopTask.java:54

    private SqoopParameters sqoopParameters;

    private final TaskExecutionContext taskExecutionContext;

    private SqoopTaskExecutionContext sqoopTaskExecutionContext;

    public SqoopTask(TaskExecutionContext taskExecutionContext) {
        super(taskExecutionContext);
        this.taskExecutionContext = taskExecutionContext;
    }

    @Override
    public void init() {
        sqoopParameters =
                JSONUtils.parseObject(taskExecutionContext.getTaskParams(), SqoopParameters.class);
        log.info("Initialize sqoop task params {}", JSONUtils.toPrettyJsonString(sqoopParameters));
        if (null == sqoopParameters) {
            throw new TaskException("Sqoop Task params is null");
        }

        if (!sqoopParameters.checkParameters()) {
            throw new TaskException("Sqoop Task params check fail");
        }

        sqoopTaskExecutionContext =
                sqoopParameters.generateExtendedContext(taskExecutionContext.getResourceParametersHelper());

        SensitiveDataConverter.addMaskPattern(SqoopConstants.SQOOP_PASSWORD_REGEX);
    }

    @Override
    protected String getScript() {
        // get sqoop scripts
        SqoopJobGenerator generator = new SqoopJobGenerator();
        return generator.generateSqoopJob(sqoopParameters, sqoopTaskExecutionContext);

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Open the Sqoop task node in the UI and re-save it so valid params are generated
  2. Validate the workflow definition JSON contains a non-empty taskParams object for the sqoop node
  3. Check the log's 'Initialize sqoop task params' line above the exception to see what was parsed
  4. Migrate/fix legacy task definitions after a version upgrade

Example fix

// before
{"taskParams":{"localParams":[]}} // missing sqoop job fields -> parsed null
// after
{"taskParams":{"jobType":"TEMPLATE","sourceType":"MYSQL","targetType":"HDFS","localParams":[]}}
Defensive patterns

Strategy: validation

Validate before calling

com.fasterxml.jackson.databind.JsonNode n =
        com.fasterxml.jackson.databind.json.JsonMapper.builder().build().readTree(taskParams);
if (n == null || !n.has("sourceType") || !n.has("targetType")) {
    throw new IllegalStateException("Sqoop taskParams incomplete");
}

Try / catch

try {
    sqoopTask.init();
} catch (TaskException e) {
    if (e.getMessage().equals("Sqoop Task params is null")) {
        // re-save the task node in the UI to regenerate taskParams
    }
}

Prevention

When it happens

Trigger: Task params JSON is empty, malformed, or deserializes to null (e.g. wrong params structure saved by the UI or an older workflow definition incompatible with the current plugin).

Common situations: Importing a workflow JSON where the sqoop task node lost its params; upgrading DolphinScheduler between versions with changed SqoopParameters schema; hand-editing workflow definition files.

Understand the failure class

Background: "failed to unmarshal" / json.Unmarshal errors: why parsing a response into a Go struct fails and how to fix it — this error's family across 23 libraries.

Related errors


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