apache/seatunnel · critical · IMapStorageException

Failed to login user from keytab : ${keytabPath} and kerbero

Error message

Failed to login user from keytab : ${keytabPath} and kerberos principal : ${principal}

What it means

HdfsConfiguration.authenticateKerberos wraps IOException from UserGroupInformation.loginUserFromKeytab into this IMapStorageException. It means Kerberos authentication against the KDC with the given principal/keytab failed, so no HDFS configuration can be finalized.

Source

Thrown at seatunnel-engine/seatunnel-engine-storage/imap-storage-plugins/imap-storage-file/src/main/java/org/apache/seatunnel/engine/imap/storage/file/config/HdfsConfiguration.java:107

        return hadoopConf;
    }

    /**
     * Authenticate kerberos
     *
     * @param kerberosPrincipal kerberos principal
     * @param kerberosKeytabFilePath kerberos keytab file path
     * @param hdfsConf hdfs configuration
     * @throws IMapStorageException authentication exception
     */
    private void authenticateKerberos(
            String kerberosPrincipal, String kerberosKeytabFilePath, Configuration hdfsConf)
            throws IMapStorageException {
        UserGroupInformation.setConfiguration(hdfsConf);
        try {
            UserGroupInformation.loginUserFromKeytab(kerberosPrincipal, kerberosKeytabFilePath);
        } catch (IOException e) {
            throw new IMapStorageException(
                    "Failed to login user from keytab : "
                            + kerberosKeytabFilePath
                            + " and kerberos principal : "
                            + kerberosPrincipal,
                    e);
        }
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Verify the keytab file exists and is readable by the process user (ls -l, klist -kt <keytab>).
  2. Confirm the principal is present in the keytab and matches the configured value (klist -kt output).
  3. Regenerate/redistribute the keytab if it is stale, then retry.
  4. Check /etc/krb5.conf realm and KDC reachability (kinit -kt <keytab> <principal> must succeed).
  5. Fix host clock sync (NTP) if clock skew errors appear in the cause.

Example fix

// before
# config
kerberosKeytabFilePath: "/etc/security/keytabs/old.keytab"
// after
# regenerate and deploy keytab, verify, then:
# kinit -kt /etc/security/keytabs/st.keytab st/_HOST@EXAMPLE.COM
kerberosKeytabFilePath: "/etc/security/keytabs/st.keytab"
Defensive patterns

Strategy: validation

Validate before calling

boolean keytabUsable = java.nio.file.Files.isReadable(java.nio.file.Paths.get(keytabPath));
// shell check before deploy:
// klist -kt /etc/security/keytabs/st.keytab && kinit -kt /etc/security/keytabs/st.keytab st/_HOST@EXAMPLE.COM

Try / catch

try { Configuration c = hdfsConfiguration.buildConfiguration(config); } catch (IMapStorageException e) { if (e.getMessage().contains("Failed to login user from keytab")) { /* verify keytab/principal/KDC, then retry */ } }

Prevention

When it happens

Trigger: Calling buildConfiguration() with kerberos enabled where the keytab file path does not exist or is unreadable, the principal is not in the keytab, KDC is unreachable, or clock skew exceeds tolerance.

Common situations: Wrong keytab path after deployment; keytab regenerated on the KDC with new KVNO so the local copy is stale; hostname mismatch between principal _HOST replacement and the actual host; krb5.conf missing or pointing at the wrong realm; large clock drift between nodes and KDC.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/74b298d2d53cdaf6. Report an issue: GitHub.