{"record":{"id":"3383da5bb3425585","repo":"apache/dolphinscheduler","slug":"sqoop-task-params-check-fail","errorCode":null,"errorMessage":"Sqoop Task params check fail","messagePattern":"Sqoop Task params check fail","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":58,"sourceCode":"\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\n    }\n\n    @Override\n    public AbstractParameters getParameters() {","sourceCodeStart":40,"sourceCodeEnd":76,"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#L40-L76","documentation":"After parsing SqoopParameters, init() calls sqoopParameters.checkParameters() to validate required fields for the chosen source/target combination. If validation fails, the task throws this TaskException.","triggerScenarios":"checkParameters() returns false because required fields for the configured source/target type are missing or invalid (e.g. empty source/target type, missing connection params, missing table/query for the selected job type).","commonSituations":"Selecting a source (e.g. HDFS) but leaving exportDir empty; choosing MySQL source without datasource/tableName; partially filled Sqoop form after copy-pasting a task node; version changes in required fields.","solutions":["Review SqoopParameters.checkParameters() requirements for your source/target combination and fill all mandatory fields (datasource, table/query, target path, etc.)","Re-open the Sqoop task in the UI and complete all required form fields","Test the equivalent sqoop command manually to confirm all arguments are valid"],"exampleFix":"// before\nsourceType=HDFS, targetType=MYSQL, targetMysqlTableName=\"\" // check fail\n// after\nsourceType=HDFS, targetType=MYSQL, targetMysqlTableName=\"user_events\", targetMysqlColumns=\"id,name\"","handlingStrategy":"validation","validationCode":"SqoopParameters p = JSONUtils.parseObject(taskParams, SqoopParameters.class);\nif (p == null || !p.checkParameters()) {\n    throw new IllegalStateException(\"Sqoop params incomplete for source/target combination\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    sqoopTask.init();\n} catch (TaskException e) {\n    if (e.getMessage().equals(\"Sqoop Task params check fail\")) {\n        // complete required source/target fields in the task form\n    }\n}","preventionTips":["Fill all mandatory Sqoop form fields for the chosen source/target types","Test the equivalent sqoop command manually first","Re-check params after copying tasks between workflows"],"tags":["sqoop","validation","task-params"],"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"}