[
https://issues.apache.org/jira/browse/HDFS-9888?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15176515#comment-15176515
]
Xiao Chen commented on HDFS-9888:
---------------------------------
Sure Zhe, here's a sample error:
{noformat}
Error Message
Login failure for balancer/[email protected] from keytab
/data/jenkins/workspace/CDH5-Hadoop-HDFS-2.6.0/hadoop-hdfs-project/hadoop-hdfs/target/test-dir/TestBalancer/balancer.keytab
Stacktrace
java.io.IOException: Login failure for balancer/[email protected] from
keytab
/data/jenkins/workspace/CDH5-Hadoop-HDFS-2.6.0/hadoop-hdfs-project/hadoop-hdfs/target/test-dir/TestBalancer/balancer.keytab
at
org.apache.hadoop.security.authentication.util.KerberosName.getShortName(KerberosName.java:389)
at org.apache.hadoop.security.User.<init>(User.java:48)
at org.apache.hadoop.security.User.<init>(User.java:43)
at
org.apache.hadoop.security.UserGroupInformation$HadoopLoginModule.commit(UserGroupInformation.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:762)
at
javax.security.auth.login.LoginContext.access$000(LoginContext.java:203)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:690)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at
javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:687)
at javax.security.auth.login.LoginContext.login(LoginContext.java:596)
at
org.apache.hadoop.security.UserGroupInformation.loginUserFromKeytabAndReturnUGI(UserGroupInformation.java:1171)
at
org.apache.hadoop.hdfs.server.balancer.TestBalancer.testBalancerWithKeytabs(TestBalancer.java:1594)
{noformat}
Basically the exception above is from
[KerberosName|https://github.com/apache/hadoop/blob/trunk/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/KerberosName.java#L389]
cannot find rules to apply. Further logging shows that the realm locally is
'APACHE.ORG' instead of 'EXAMPLE.COM'. (a change by HDFS-3016 back in 2012,
which is not present locally. Even if that's present, this patch will make the
test safer.)
> TestBalancer#testBalancerWithKeytabs should reset KerberosName in test case
> setup
> ---------------------------------------------------------------------------------
>
> Key: HDFS-9888
> URL: https://issues.apache.org/jira/browse/HDFS-9888
> Project: Hadoop HDFS
> Issue Type: Test
> Reporter: Xiao Chen
> Assignee: Xiao Chen
> Priority: Minor
> Attachments: HDFS-9888.01.patch
>
>
> In some local environments, {{TestBalancer#testBalancerWithKeytabs}} may
> fail. Specifically, running itself passes, but running {{TestBalancer}} suite
> always fail. This is due to:
> # Kerberos setup is done at the test case setup
> # static variable {{KerberosName#defaultRealm}} is set when class
> initialization - before {{testBalancerWithKeytabs}} setup
> # local default realm is different than test case default realm
> This is mostly an environment specific problem, but let's not make such
> assumption in the test.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)