hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Nauroth (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-12718) Incorrect error message by fs -put local dir without permission
Date Fri, 13 May 2016 20:04:13 GMT

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

Chris Nauroth commented on HADOOP-12718:
----------------------------------------

I'm considering reverting this patch for a few reasons.

First, the patch was not coded to handle Windows correctly.  Changing it to use {{FileUtil#canRead}}
would solve that.

However, the larger issue is that this might be backwards-incompatible.  Prior to the patch,
lack of access would return {{null}}.  After the patch, lack of access throws an exception.
 Although this matches HDFS semantics, applications often have different expectations of the
local file system.  If an application was coded to check for {{null}}, but not handle {{AccessDeniedException}},
then there is a risk of breaking that application.

Cc [~stevel@apache.org] for a second opinion from the file system contract perspective.  The
current spec for {{listStatus}} does not explicitly require a pre-condition check that lack
of access results in {{AccessDeniedException}}.

http://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-common/filesystem/filesystem.html

If we revert this, then something will have to be done about YARN-4842, which included tests
that depended on the new exception message.  Cc [~xgong].

I won't revert immediately.  I'll wait until next week so that others get time to consider
and comment.

> Incorrect error message by fs -put local dir without permission
> ---------------------------------------------------------------
>
>                 Key: HADOOP-12718
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12718
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: John Zhuge
>            Assignee: John Zhuge
>            Priority: Minor
>              Labels: supportability
>             Fix For: 2.8.0
>
>         Attachments: HADOOP-12718.001.patch, HADOOP-12718.002.patch, TestFsShellCopyPermission-output.001.txt,
TestFsShellCopyPermission-output.002.txt, TestFsShellCopyPermission.001.patch
>
>
> When the user doesn't have access permission to the local directory, the "hadoop fs -put"
command prints a confusing error message "No such file or directory".
> {noformat}
> $ whoami
> systest
> $ cd /home/systest
> $ ls -ld .
> drwx------. 4 systest systest 4096 Jan 13 14:21 .
> $ mkdir d1
> $ sudo -u hdfs hadoop fs -put d1 /tmp
> put: `d1': No such file or directory
> {noformat}
> It will be more informative if the message is:
> {noformat}
> put: d1 (Permission denied)
> {noformat}
> If the source is a local file, the error message is ok:
> {noformat}
> put: f1 (Permission denied)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message