{"record":{"id":"7a329adff210fbb6","repo":"apache/seatunnel","slug":"please-set-kerberoskeytabpath","errorCode":null,"errorMessage":"Please set kerberosKeytabPath","messagePattern":"Please set kerberosKeytabPath","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/hadoop/HadoopFileSystemProxy.java","lineNumber":462,"sourceCode":"        if (cause != null) {\n            enhanced.addSuppressed(cause);\n        }\n        return enhanced;\n    }\n\n    private boolean enableKerberos() {\n        boolean kerberosPrincipalEmpty = StringUtils.isBlank(hadoopConf.getKerberosPrincipal());\n        boolean kerberosKeytabPathEmpty = StringUtils.isBlank(hadoopConf.getKerberosKeytabPath());\n        if (kerberosKeytabPathEmpty && kerberosPrincipalEmpty) {\n            return false;\n        }\n        if (!kerberosPrincipalEmpty && !kerberosKeytabPathEmpty) {\n            return true;\n        }\n        if (kerberosPrincipalEmpty) {\n            throw new IllegalArgumentException(\"Please set kerberosPrincipal\");\n        }\n        throw new IllegalArgumentException(\"Please set kerberosKeytabPath\");\n    }\n\n    private void initializeWithKerberosLogin() throws IOException, InterruptedException {\n        Pair<UserGroupInformation, FileSystem> pair =\n                HadoopLoginFactory.loginWithKerberos(\n                        configuration,\n                        hadoopConf.getKrb5Path(),\n                        hadoopConf.getKerberosPrincipal(),\n                        hadoopConf.getKerberosKeytabPath(),\n                        (configuration, userGroupInformation) -> {\n                            this.userGroupInformation = userGroupInformation;\n                            this.fileSystem = FileSystem.get(configuration);\n                            return Pair.of(userGroupInformation, fileSystem);\n                        });\n        userGroupInformation = pair.getKey();\n        fileSystem = pair.getValue();\n        fileSystem.setWriteChecksum(false);\n        log.info(\"Create FileSystem success with Kerberos: {}.\", hadoopConf.getKerberosPrincipal());","sourceCodeStart":444,"sourceCodeEnd":480,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/hadoop/HadoopFileSystemProxy.java#L444-L480","documentation":"The counterpart of the kerberosPrincipal check: enableKerberos requires both a principal and a keytab. When the principal is set but kerberos_keytab_path is empty/absent, it throws IllegalArgumentException(\"Please set kerberosKeytabPath\").","triggerScenarios":"Setting kerberos_principal (with Kerberos enabled) but omitting kerberos_keytab_path in the file connector config; initialize/doWithHadoopAuth calls enableKerberos and reaches the final throw.","commonSituations":"Trying password-based Kerberos and assuming keytab is optional; forgetting to mount/copy the keytab path into containerized deployments so the config value was removed; partial config migrations.","solutions":["Add kerberos_keytab_path = \"/path/to/user.keytab\" to the connector config","Ensure the keytab file exists and is readable by the SeaTunnel process at that path (mount it in containers)","Confirm enable_kerberos = true is intentional and both kerberos options are present"],"exampleFix":"// before\nHdfsFile {\n  enable_kerberos = true\n  kerberos_principal = \"hdfs@EXAMPLE.COM\"\n}\n// after\nHdfsFile {\n  enable_kerberos = true\n  kerberos_principal = \"hdfs@EXAMPLE.COM\"\n  kerberos_keytab_path = \"/etc/security/keytab/hdfs.keytab\"\n}","handlingStrategy":"validation","validationCode":"if (Boolean.parseBoolean(config.get(\"enable_kerberos\")) && (config.get(\"kerberos_keytab_path\") == null || config.get(\"kerberos_keytab_path\").trim().isEmpty())) {\n    throw new IllegalArgumentException(\"enable_kerberos=true requires kerberos_keytab_path\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    initHadoopFileSystem();\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"kerberosKeytabPath\")) {\n        // fix config: add kerberos_keytab_path and ensure file exists\n    } else {\n        throw e;\n    }\n}","preventionTips":["Set principal and keytab as a pair; verify the keytab file exists and is readable at job runtime","In containers, mount the keytab and reference the mounted path"],"tags":["kerberos","config","hadoop"],"backgroundTag":"missing-required-config-field","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}