{"record":{"id":"392930dc744a73b9","repo":"apache/dolphinscheduler","slug":"sqoop-hdfs-export-dir-is-null","errorCode":null,"errorMessage":"Sqoop hdfs export dir is null","messagePattern":"Sqoop hdfs export dir is null","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-sqoop/src/main/java/org/apache/dolphinscheduler/plugin/task/sqoop/generator/sources/HdfsSourceGenerator.java","lineNumber":56,"sourceCode":"    public String generate(\n                           SqoopParameters sqoopParameters, SqoopTaskExecutionContext sqoopTaskExecutionContext) {\n\n        StringBuilder hdfsSourceSb = new StringBuilder();\n\n        try {\n            SourceHdfsParameter sourceHdfsParameter =\n                    JSONUtils.parseObject(\n                            sqoopParameters.getSourceParams(), SourceHdfsParameter.class);\n\n            if (null != sourceHdfsParameter) {\n                if (StringUtils.isNotEmpty(sourceHdfsParameter.getExportDir())) {\n                    hdfsSourceSb\n                            .append(SPACE)\n                            .append(HDFS_EXPORT_DIR)\n                            .append(SPACE)\n                            .append(sourceHdfsParameter.getExportDir());\n                } else {\n                    throw new IllegalArgumentException(\"Sqoop hdfs export dir is null\");\n                }\n            }\n        } catch (Exception e) {\n            log.error(String.format(\"Sqoop hdfs source params build failed: [%s]\", e.getMessage()));\n        }\n\n        return hdfsSourceSb.toString();\n    }\n}\n","sourceCodeStart":38,"sourceCodeEnd":66,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-sqoop/src/main/java/org/apache/dolphinscheduler/plugin/task/sqoop/generator/sources/HdfsSourceGenerator.java#L38-L66","documentation":"HdfsSourceGenerator.generate builds the '--export-dir' argument for an HDFS source. If sourceHdfsParameter.getExportDir() is empty/null, it throws IllegalArgumentException; the outer catch logs 'Sqoop hdfs source params build failed' and the job proceeds without the export dir argument, causing downstream failure.","triggerScenarios":"Source type is HDFS but the HDFS source parameter exportDir was not filled in the task form/JSON (null or empty string).","commonSituations":"Partially completed Sqoop HDFS-source configuration; exporting a copied task where the dir belonged to another cluster; UI form submitted before entering the path.","solutions":["Set the HDFS exportDir field (e.g. /data/output/events) on the Sqoop task's HDFS source configuration","Validate that the directory exists on HDFS and is readable by the sqoop job user","Note the message is swallowed into a log line — also check for a later 'sqoop task failed' due to missing --export-dir"],"exampleFix":"// before\nsourceHdfsParameter.setExportDir(\"\");\n// after\nsourceHdfsParameter.setExportDir(\"/data/output/events\");","handlingStrategy":"validation","validationCode":"if (\"HDFS\".equals(params.getSourceType()) &&\n    (params.getSourceHdfsParameter() == null || isEmpty(params.getSourceHdfsParameter().getExportDir()))) {\n    throw new IllegalStateException(\"HDFS source requires non-empty exportDir\");\n}","typeGuard":null,"tryCatchPattern":"// This IAE is swallowed into a log line; watch logs instead:\nif (logs.stream().anyMatch(l -> l.contains(\"Sqoop hdfs export dir is null\"))) {\n    // abort the job and fix exportDir before retry\n}","preventionTips":["Always set exportDir when using HDFS as Sqoop source","Verify the HDFS path exists before scheduling","Watch for the 'Sqoop hdfs source params build failed' log during testing"],"tags":["sqoop","hdfs","missing-parameter"],"backgroundTag":"missing-required-argument","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"}