This is an automated email from the ASF dual-hosted git repository. cnauroth pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push: new b6916ebe905 HADOOP-19401: Improve error message when OS can't identify the current user. b6916ebe905 is described below commit b6916ebe905eb8fac2b2b4d820bf88a5854cbec1 Author: Chris Nauroth <cnaur...@apache.org> AuthorDate: Fri Jan 24 22:43:26 2025 +0000 HADOOP-19401: Improve error message when OS can't identify the current user. Closes #7325 Signed-off-by: Shilun Fan <slfan1...@apache.org> Signed-off-by: Steve Loughran <ste...@apache.org> Signed-off-by: Ayush Saxena <ayushsax...@apache.org> --- .../main/java/org/apache/hadoop/security/UGIExceptionMessages.java | 1 + .../main/java/org/apache/hadoop/security/UserGroupInformation.java | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UGIExceptionMessages.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UGIExceptionMessages.java index c4d30e509e3..27fdb083df8 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UGIExceptionMessages.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UGIExceptionMessages.java @@ -27,6 +27,7 @@ final class UGIExceptionMessages { public static final String FOR_USER = " for user: "; public static final String FOR_PRINCIPAL = " for principal: "; public static final String FROM_KEYTAB = " from keytab "; + public static final String INVALID_UID = "Invalid UID, could not determine effective user"; public static final String LOGIN_FAILURE = "Login failure"; public static final String LOGOUT_FAILURE = "Logout failure"; public static final String MUST_FIRST_LOGIN = diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java index 305e5e10af3..6525460d561 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java @@ -2075,6 +2075,12 @@ private static UserGroupInformation doSubjectLogin( } return ugi; } catch (LoginException le) { + String msg = le.getMessage(); + if (msg != null && msg.contains("invalid null input")) { + // This error from the JDK indicates that the OS couldn't map the UID of this process to an + // actual user. Throw this as an IOException, because it's not related to Kerberos. + throw new IOException(INVALID_UID, le); + } KerberosAuthException kae = new KerberosAuthException(FAILURE_TO_LOGIN, le); if (params != null) { --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org