{"record":{"id":"b4351f7389c7ab52","repo":"apache/seatunnel","slug":"please-set-kerberosprincipal-b4351f","errorCode":null,"errorMessage":"Please set kerberosPrincipal","messagePattern":"Please set kerberosPrincipal","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/utils/HiveMetaStoreProxyUtils.java","lineNumber":40,"sourceCode":"\nimport lombok.experimental.UtilityClass;\n\n@UtilityClass\npublic class HiveMetaStoreProxyUtils {\n\n    public boolean enableKerberos(ReadonlyConfig config) {\n        boolean kerberosPrincipalEmpty =\n                config.getOptional(FileBaseSourceOptions.KERBEROS_PRINCIPAL).isPresent();\n        boolean kerberosKeytabPathEmpty =\n                config.getOptional(FileBaseSourceOptions.KERBEROS_KEYTAB_PATH).isPresent();\n        if (kerberosKeytabPathEmpty && kerberosPrincipalEmpty) {\n            return true;\n        }\n        if (!kerberosPrincipalEmpty && !kerberosKeytabPathEmpty) {\n            return false;\n        }\n        if (kerberosPrincipalEmpty) {\n            throw new IllegalArgumentException(\"Please set kerberosPrincipal\");\n        }\n        throw new IllegalArgumentException(\"Please set kerberosKeytabPath\");\n    }\n\n    public boolean enableRemoteUser(ReadonlyConfig config) {\n        return config.getOptional(FileBaseSourceOptions.REMOTE_USER).isPresent();\n    }\n}\n","sourceCodeStart":22,"sourceCodeEnd":49,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/utils/HiveMetaStoreProxyUtils.java#L22-L49","documentation":"IllegalArgumentException thrown by HiveMetaStoreProxyUtils.enableKerberos when kerberos authentication is requested but the kerberosPrincipal config is missing/empty. It fails fast at startup instead of failing later during metastore login.","triggerScenarios":"enableKerberos(config) is called with kerberosPrincipal absent while kerberosKeytabPath is set (or both absent but auth.kerberos is enabled).","commonSituations":"Configuring Hive connector for a secured cluster but forgetting auth.kerberos-principal; only copying the keytab path from a template; variable interpolation resolving to an empty string.","solutions":["Add auth.kerberos-principal to the connector config (e.g. \"auth.kerberos-principal\" = \"user/_HOST@REALM\")","Ensure the value is not empty (check for failed env/variable substitution)","If kerberos is not intended, remove both kerberos principal and keytab options","Validate config with ReadonlyConfig.getOptional before constructing the catalog"],"exampleFix":"// before\nHive {\n  auth.kerberos-keytab-path = \"/etc/security/keytabs/hive.keytab\"\n}\n// after\nHive {\n  auth.kerberos-principal = \"hive/_HOST@EXAMPLE.COM\"\n  auth.kerberos-keytab-path = \"/etc/security/keytabs/hive.keytab\"\n}","handlingStrategy":"validation","validationCode":"ReadonlyConfig cfg = ReadonlyConfig.fromMap(configMap);\nboolean principalSet = cfg.getOptional(KERBEROS_PRINCIPAL_OPTION).map(s -> !s.trim().isEmpty()).orElse(false);","typeGuard":"boolean kerberosPrincipalValid = principal != null && !principal.trim().isEmpty();","tryCatchPattern":"try { enableKerberos(config); } catch (IllegalArgumentException e) { throw new IllegalArgumentException(\"Invalid kerberos config: \" + e.getMessage()); }","preventionTips":["Always set principal and keytab together for secured clusters","Assert both values non-empty at config load time","Check variable substitution actually resolved","Use a config template with all kerberos keys present"],"tags":["hive","kerberos","config"],"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"}