Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D7A6E2009D9 for ; Thu, 19 May 2016 22:56:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D60EF160A1E; Thu, 19 May 2016 20:56:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 2C2CF1609AE for ; Thu, 19 May 2016 22:56:14 +0200 (CEST) Received: (qmail 66143 invoked by uid 500); 19 May 2016 20:56:13 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 66120 invoked by uid 99); 19 May 2016 20:56:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 May 2016 20:56:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 006842C1F5D for ; Thu, 19 May 2016 20:56:13 +0000 (UTC) Date: Thu, 19 May 2016 20:56:13 +0000 (UTC) From: "Kihwal Lee (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-10417) Improve error message from checkBlockLocalPathAccess MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 19 May 2016 20:56:15 -0000 [ https://issues.apache.org/jira/browse/HDFS-10417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15292121#comment-15292121 ] Kihwal Lee commented on HDFS-10417: ----------------------------------- Committed this to trunk, branch-2 and branch-2.8. Thanks for the patch, [~tianyin]. > Improve error message from checkBlockLocalPathAccess > ---------------------------------------------------- > > Key: HDFS-10417 > URL: https://issues.apache.org/jira/browse/HDFS-10417 > Project: Hadoop HDFS > Issue Type: Improvement > Components: datanode > Affects Versions: 2.7.2 > Reporter: Tianyin Xu > Assignee: Tianyin Xu > Priority: Minor > Fix For: 2.8.0 > > Attachments: HDFS-10417.000.patch, HDFS-10417.001.patch, HDFS-10417.002.patch > > > The exception msg thrown by {{checkBlockLocalPathAccess}} is very specific to the implementation detail. It's really hard for users to understand it unless she reads and understands the code. > The code is shown as follows: > {code:title=org.apache.hadoop.hdfs.server.datanode.DataNode|borderStyle=solid} > private void checkBlockLocalPathAccess() throws IOException { > checkKerberosAuthMethod("getBlockLocalPathInfo()"); > String currentUser = UserGroupInformation.getCurrentUser().getShortUserName(); > if (!usersWithLocalPathAccess.contains(currentUser)) { > throw new AccessControlException( > "Can't continue with getBlockLocalPathInfo() " > + "authorization. The user " + currentUser > + " is not allowed to call getBlockLocalPathInfo"); > } > } > {code} > (basically she needs to understand the code logic of getBlockLocalPathInfo) > \\ > Note that {{usersWithLocalPathAccess}} is a *private final* purely coming from the configuration settings of {{dfs.block.local-path-access.user}}, > {code:title=org.apache.hadoop.hdfs.server.datanode.DataNode|borderStyle=solid} > private final List usersWithLocalPathAccess; > .... > this.usersWithLocalPathAccess = Arrays.asList( > conf.getTrimmedStrings(DFSConfigKeys.DFS_BLOCK_LOCAL_PATH_ACCESS_USER_KEY)); > {code} > In other word, the checking fails simply because the current user is not specified in the configuration setting of {{dfs.block.local-path-access.user}}. The log message should be much more clearer to make it easy for users to take actions, as demonstrated in the attached patch. > Thanks! -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org