From 28d2753d2f86237868034ca1695f84e2eb2ab6cf Mon Sep 17 00:00:00 2001 From: Viraj Jasani Date: Tue, 28 Feb 2023 17:34:12 -0800 Subject: [PATCH] HADOOP-18645. Provide keytab file key name with ServiceStateException (#5433) Signed-off-by: Tao Li --- .../src/main/java/org/apache/hadoop/security/SecurityUtil.java | 3 ++- .../server/federation/router/TestRouterWithSecureStartup.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java index 3369869bde..d045a7f6fc 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java @@ -314,7 +314,8 @@ public static void login(final Configuration conf, String keytabFilename = conf.get(keytabFileKey); if (keytabFilename == null || keytabFilename.length() == 0) { - throw new IOException("Running in secure mode, but config doesn't have a keytab"); + throw new IOException( + "Running in secure mode, but config doesn't have a keytab for key: " + keytabFileKey); } String principalConfig = conf.get(userNameKey, System diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterWithSecureStartup.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterWithSecureStartup.java index b660b4bcbb..b0c0c050bf 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterWithSecureStartup.java +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/router/TestRouterWithSecureStartup.java @@ -56,7 +56,8 @@ public void testStartupWithoutSpnegoPrincipal() throws Exception { @Test public void testStartupWithoutKeytab() throws Exception { testCluster(DFS_ROUTER_KEYTAB_FILE_KEY, - "Running in secure mode, but config doesn't have a keytab"); + "Running in secure mode, but config doesn't have a keytab for " + + "key: dfs.federation.router.keytab.file"); } @Test