Unexpected error condition executing the kadmin command. STDERR: kadmin: Matching credential not found
Hello all,
I'm trying to kerberize the Ambari 2.7.3 cluster. However, during the setup, I get the following error:
Caused by: org.apache.ambari.server.serveraction.kerberos.KerberosOperationException: Unexpected error condition executing the kadmin command. STDERR: kadmin: Matching credential not found (filename: /tmp/ambari_krb_142308985016794830cc) while initializing kadmin interface
at org.apache.ambari.server.serveraction.kerberos.MITKerberosOperationHandler.invokeKAdmin(MITKerberosOperationHandler.java:323)
at org.apache.ambari.server.serveraction.kerberos.MITKerberosOperationHandler.principalExists(MITKerberosOperationHandler.java:123)
at org.apache.ambari.server.serveraction.kerberos.KerberosOperationHandler.testAdministratorCredentials(KerberosOperationHandler.java:314)
at org.apache.ambari.server.controller.KerberosHelperImpl.validateKDCCredentials(KerberosHelperImpl.java:2133)
All of the authentication settings are okay, because I am able to kinit and use the kadmin interface from shell.
It seems that the problem is that Ambari tries to do the following:
kinit -p admin/admin@EXAMPLE.COM
kadmin -c /tmp/ambari_krb_...
While it should be doing the following:
kinit -S kadmin/admin@EXAMPLE.COM admin/admin@EXAMPLE.COM
kadmin -c /tmp/ambari_krb...
I've tried replicating the two settings and confirmed my guess. The second code works from the shell. Further, If I intercept the temporarily generated credentials by ambari with my own, the code works.
How can I fix this behaviour? This seem like a bug in Ambari code -- which part should I edit to fix this?

