{"record":{"id":"ea21dac8d07324e6","repo":"apache/dolphinscheduler","slug":"sqoop-task-params-is-null","errorCode":null,"errorMessage":"Sqoop Task params is null","messagePattern":"Sqoop Task params is null","errorType":"validation","errorClass":"TaskException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-sqoop/src/main/java/org/apache/dolphinscheduler/plugin/task/sqoop/SqoopTask.java","lineNumber":54,"sourceCode":"\n    private SqoopParameters sqoopParameters;\n\n    private final TaskExecutionContext taskExecutionContext;\n\n    private SqoopTaskExecutionContext sqoopTaskExecutionContext;\n\n    public SqoopTask(TaskExecutionContext taskExecutionContext) {\n        super(taskExecutionContext);\n        this.taskExecutionContext = taskExecutionContext;\n    }\n\n    @Override\n    public void init() {\n        sqoopParameters =\n                JSONUtils.parseObject(taskExecutionContext.getTaskParams(), SqoopParameters.class);\n        log.info(\"Initialize sqoop task params {}\", JSONUtils.toPrettyJsonString(sqoopParameters));\n        if (null == sqoopParameters) {\n            throw new TaskException(\"Sqoop Task params is null\");\n        }\n\n        if (!sqoopParameters.checkParameters()) {\n            throw new TaskException(\"Sqoop Task params check fail\");\n        }\n\n        sqoopTaskExecutionContext =\n                sqoopParameters.generateExtendedContext(taskExecutionContext.getResourceParametersHelper());\n\n        SensitiveDataConverter.addMaskPattern(SqoopConstants.SQOOP_PASSWORD_REGEX);\n    }\n\n    @Override\n    protected String getScript() {\n        // get sqoop scripts\n        SqoopJobGenerator generator = new SqoopJobGenerator();\n        return generator.generateSqoopJob(sqoopParameters, sqoopTaskExecutionContext);\n","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-sqoop/src/main/java/org/apache/dolphinscheduler/plugin/task/sqoop/SqoopTask.java#L36-L72","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Open the Sqoop task node in the UI and re-save it so valid params are generated","Validate the workflow definition JSON contains a non-empty taskParams object for the sqoop node","Check the log's 'Initialize sqoop task params' line above the exception to see what was parsed","Migrate/fix legacy task definitions after a version upgrade"],"exampleFix":"// before\n{\"taskParams\":{\"localParams\":[]}} // missing sqoop job fields -> parsed null\n// after\n{\"taskParams\":{\"jobType\":\"TEMPLATE\",\"sourceType\":\"MYSQL\",\"targetType\":\"HDFS\",\"localParams\":[]}}","handlingStrategy":"validation","validationCode":"com.fasterxml.jackson.databind.JsonNode n =\n        com.fasterxml.jackson.databind.json.JsonMapper.builder().build().readTree(taskParams);\nif (n == null || !n.has(\"sourceType\") || !n.has(\"targetType\")) {\n    throw new IllegalStateException(\"Sqoop taskParams incomplete\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    sqoopTask.init();\n} catch (TaskException e) {\n    if (e.getMessage().equals(\"Sqoop Task params is null\")) {\n        // re-save the task node in the UI to regenerate taskParams\n    }\n}","preventionTips":["Re-save imported workflows in the UI to normalize taskParams","Validate workflow JSON after upgrades or manual edits","Log and review taskParams at task submission time"],"tags":["sqoop","json","task-params"],"backgroundTag":"json-unmarshal-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"}