You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2024/09/14 18:45:00 UTC

[jira] [Commented] (HADOOP-19275) dtutil cancel command fails with NullPointerException

    [ https://issues.apache.org/jira/browse/HADOOP-19275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17881809#comment-17881809 ] 

ASF GitHub Bot commented on HADOOP-19275:
-----------------------------------------

devabhishekpal opened a new pull request, #7045:
URL: https://github.com/apache/hadoop/pull/7045

   
   
   <!--
     Thanks for sending a pull request!
       1. If this is your first time, please read our contributor guidelines: https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute
       2. Make sure your PR title starts with JIRA issue id, e.g., 'HADOOP-17799. Your PR title ...'.
   -->
   
   ### Description of PR
   The hadoop dtutil cancel command gives NullPointerException.
   
   ```java.lang.NullPointerException
   	at org.apache.hadoop.security.authentication.util.KerberosName.getShortName(KerberosName.java:422)
   	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.createRemoteUser(UserGroupInformation.java:1418)
   	at org.apache.hadoop.security.UserGroupInformation.createRemoteUser(UserGroupInformation.java:1402)
   	at org.apache.hadoop.security.token.delegation.AbstractDelegationTokenIdentifier.getUser(AbstractDelegationTokenIdentifier.java:80)
   	at org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier.getUser(DelegationTokenIdentifier.java:81)
   	at org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier.toString(DelegationTokenIdentifier.java:91)
   	at java.base/java.lang.String.valueOf(String.java:2951)
   	at java.base/java.lang.StringBuilder.append(StringBuilder.java:168)
   	at org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier.stringifyToken(DelegationTokenIdentifier.java:123)
   	at org.apache.hadoop.hdfs.DFSClient$Renewer.cancel(DFSClient.java:804)
   	at org.apache.hadoop.security.token.Token.cancel(Token.java:527)
   	at org.apache.hadoop.security.token.DtFileOperations.removeTokenFromFile(DtFileOperations.java:283)
   	at org.apache.hadoop.security.token.DtUtilShell$Remove.execute(DtUtilShell.java:320)
   	at org.apache.hadoop.tools.CommandShell.run(CommandShell.java:72)
   	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:81)
   	at org.apache.hadoop.security.token.DtUtilShell.main(DtUtilShell.java:361)
   ```
   This is because it is trying to create a User and in User.java we are calling [this](https://github.com/apache/hadoop/blob/ea6e0f7cd58d0129897dfc7870aee188be80a904/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/User.java#L48) line.
   
   But due to this direct call it doesn't initialize the auth_to_local rules and causes NPE in [here](https://github.com/apache/hadoop/blob/ea6e0f7cd58d0129897dfc7870aee188be80a904/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/KerberosName.java#L422) in KerberosName.java
   
   This patch addresses this issue.
   
   ### How was this patch tested?
   
   This patch was tested manually by creating a cluster and running the commands to verify the Delegation Token is cancelled
   
   ### For code changes:
   
   - [x] Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
   - [ ] Object storage: have the integration tests been executed and the endpoint declared according to the connector-specific documentation?
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, `NOTICE-binary` files?
   
   




> dtutil cancel command fails with NullPointerException
> -----------------------------------------------------
>
>                 Key: HADOOP-19275
>                 URL: https://issues.apache.org/jira/browse/HADOOP-19275
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: common
>            Reporter: Abhishek Pal
>            Assignee: Abhishek Pal
>            Priority: Major
>
> The hadoop dtutil cancel command gives NullPointerException.
> {code}
> java.lang.NullPointerException
> 	at org.apache.hadoop.security.authentication.util.KerberosName.getShortName(KerberosName.java:422)
> 	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.createRemoteUser(UserGroupInformation.java:1418)
> 	at org.apache.hadoop.security.UserGroupInformation.createRemoteUser(UserGroupInformation.java:1402)
> 	at org.apache.hadoop.security.token.delegation.AbstractDelegationTokenIdentifier.getUser(AbstractDelegationTokenIdentifier.java:80)
> 	at org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier.getUser(DelegationTokenIdentifier.java:81)
> 	at org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier.toString(DelegationTokenIdentifier.java:91)
> 	at java.base/java.lang.String.valueOf(String.java:2951)
> 	at java.base/java.lang.StringBuilder.append(StringBuilder.java:168)
> 	at org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier.stringifyToken(DelegationTokenIdentifier.java:123)
> 	at org.apache.hadoop.hdfs.DFSClient$Renewer.cancel(DFSClient.java:804)
> 	at org.apache.hadoop.security.token.Token.cancel(Token.java:527)
> 	at org.apache.hadoop.security.token.DtFileOperations.removeTokenFromFile(DtFileOperations.java:283)
> 	at org.apache.hadoop.security.token.DtUtilShell$Remove.execute(DtUtilShell.java:320)
> 	at org.apache.hadoop.tools.CommandShell.run(CommandShell.java:72)
> 	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:81)
> 	at org.apache.hadoop.security.token.DtUtilShell.main(DtUtilShell.java:361)
> {code}
> This is because it is trying to create a User and in User.java we are calling [this|https://github.com/apache/hadoop/blob/ea6e0f7cd58d0129897dfc7870aee188be80a904/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/User.java#L48] line.
> But due to this direct call it doesn't initialize the auth_to_local rules and causes NPE in [here|https://github.com/apache/hadoop/blob/ea6e0f7cd58d0129897dfc7870aee188be80a904/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/KerberosName.java#L422] in KerberosName.java



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org