Skip to content

Commit

Permalink
HADOOP-19401: Improve error message when OS can't identify the curren…
Browse files Browse the repository at this point in the history
…t user.

Closes #7325

Signed-off-by: Shilun Fan <[email protected]>
Signed-off-by: Steve Loughran <[email protected]>
Signed-off-by: Ayush Saxena <[email protected]>
  • Loading branch information
cnauroth committed Jan 26, 2025
1 parent 6370cd2 commit b6916eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b6916eb

Please sign in to comment.