Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-6741

Improve permission denied message when FSPermissionChecker#checkOwner fails

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.0.0, 2.5.0
    • Fix Version/s: 2.7.0
    • Component/s: None
    • Labels:
    • Hadoop Flags:
      Reviewed

      Description

      Currently, FSPermissionChecker#checkOwner throws an AccessControlException with a simple "Permission denied" message.

      When users try to set an ACL without ownership permissions, they'll see something like:

      [schu@hdfs-vanilla-1 hadoop]$ hdfs dfs -setfacl -m user:schu:--- /tmp
      setfacl: Permission denied
      

      It'd be helpful if the message had an explanation why the permission was denied to avoid confusion for users who aren't familiar with permissions.

      1. HDFS-6741.2.patch
        5 kB
        Stephen Chu
      2. HDFS-6741.2.patch
        5 kB
        Stephen Chu
      3. HDFS-6741.1.patch
        0.9 kB
        Stephen Chu

        Issue Links

          Activity

          Hide
          Stephen Chu added a comment -

          Attaching small change to improve the error message with an explanation.

          "Permission denied" ->
          "Permission denied: User

          {user}

          does not own

          {inode.getFullPathName()}

          "

          No unit test added because this just changes an exception message, which isn't being depended on right now.

          Show
          Stephen Chu added a comment - Attaching small change to improve the error message with an explanation. "Permission denied" -> "Permission denied: User {user} does not own {inode.getFullPathName()} " No unit test added because this just changes an exception message, which isn't being depended on right now.
          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12657520/HDFS-6741.1.patch
          against trunk revision .

          +1 @author. The patch does not contain any @author tags.

          -1 tests included. The patch doesn't appear to include any new or modified tests.
          Please justify why no new tests are needed for this patch.
          Also please list what manual steps were performed to verify this patch.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 javadoc. There were no new javadoc warning messages.

          +1 eclipse:eclipse. The patch built with eclipse:eclipse.

          +1 findbugs. The patch does not introduce any new Findbugs (version 2.0.3) warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          -1 core tests. The patch failed these unit tests in hadoop-hdfs-project/hadoop-hdfs:

          org.apache.hadoop.hdfs.web.TestWebHDFS
          org.apache.hadoop.hdfs.server.namenode.ha.TestPipelinesFailover

          +1 contrib tests. The patch passed contrib unit tests.

          Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/7451//testReport/
          Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/7451//console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - -1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12657520/HDFS-6741.1.patch against trunk revision . +1 @author . The patch does not contain any @author tags. -1 tests included . The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . There were no new javadoc warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. -1 core tests . The patch failed these unit tests in hadoop-hdfs-project/hadoop-hdfs: org.apache.hadoop.hdfs.web.TestWebHDFS org.apache.hadoop.hdfs.server.namenode.ha.TestPipelinesFailover +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/7451//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/7451//console This message is automatically generated.
          Hide
          Stephen Chu added a comment -

          No unit tests were added because this is small change to an exception message.

          The failing tests are not related to this change. I locally re-ran TestWebHDFS and TestPipelinesFailover multiple times successfully to double-check.

          Show
          Stephen Chu added a comment - No unit tests were added because this is small change to an exception message. The failing tests are not related to this change. I locally re-ran TestWebHDFS and TestPipelinesFailover multiple times successfully to double-check.
          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12657520/HDFS-6741.1.patch
          against trunk revision 0942c99.

          +1 @author. The patch does not contain any @author tags.

          -1 tests included. The patch doesn't appear to include any new or modified tests.
          Please justify why no new tests are needed for this patch.
          Also please list what manual steps were performed to verify this patch.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 javadoc. There were no new javadoc warning messages.

          +1 eclipse:eclipse. The patch built with eclipse:eclipse.

          -1 findbugs. The patch appears to introduce 1 new Findbugs (version 2.0.3) warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          -1 core tests. The patch failed these unit tests in hadoop-hdfs-project/hadoop-hdfs:

          org.apache.hadoop.hdfs.TestRollingUpgrade

          +1 contrib tests. The patch passed contrib unit tests.

          Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/8522//testReport/
          Findbugs warnings: https://builds.apache.org/job/PreCommit-HDFS-Build/8522//artifact/patchprocess/newPatchFindbugsWarningshadoop-hdfs.html
          Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/8522//console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - -1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12657520/HDFS-6741.1.patch against trunk revision 0942c99. +1 @author . The patch does not contain any @author tags. -1 tests included . The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . There were no new javadoc warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. -1 findbugs . The patch appears to introduce 1 new Findbugs (version 2.0.3) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. -1 core tests . The patch failed these unit tests in hadoop-hdfs-project/hadoop-hdfs: org.apache.hadoop.hdfs.TestRollingUpgrade +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/8522//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-HDFS-Build/8522//artifact/patchprocess/newPatchFindbugsWarningshadoop-hdfs.html Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/8522//console This message is automatically generated.
          Hide
          Harsh J added a comment -

          Many thanks for the patch here!

          Could you take the cue from my duplicated patch over at HDFS-7292, and change the user and inode into the more standard user= and inode= formats? We may also just print the inode object as-is, cause it carries a lot of other informational items at its tail automatically.

          I also added simple regression-catching changes at a couple places in the tests in HDFS-7292; having some of those would be beneficial as well - just in case.

          Show
          Harsh J added a comment - Many thanks for the patch here! Could you take the cue from my duplicated patch over at HDFS-7292 , and change the user and inode into the more standard user= and inode= formats? We may also just print the inode object as-is, cause it carries a lot of other informational items at its tail automatically. I also added simple regression-catching changes at a couple places in the tests in HDFS-7292 ; having some of those would be beneficial as well - just in case.
          Hide
          Stephen Chu added a comment -

          Hi Harsh, I think the patch you posted in HDFS-7292 is better. Submitting that patch here right now and assigning to you because you made the improvements.

          +1 (non-binding)

          Applied the patch and ran the new unit tests successfully.

          Show
          Stephen Chu added a comment - Hi Harsh, I think the patch you posted in HDFS-7292 is better. Submitting that patch here right now and assigning to you because you made the improvements. +1 (non-binding) Applied the patch and ran the new unit tests successfully.
          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12677356/HDFS-6741.2.patch
          against trunk revision c05b581.

          +1 @author. The patch does not contain any @author tags.

          +1 tests included. The patch appears to include 2 new or modified test files.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 javadoc. There were no new javadoc warning messages.

          +1 eclipse:eclipse. The patch built with eclipse:eclipse.

          +1 findbugs. The patch does not introduce any new Findbugs (version 2.0.3) warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          -1 core tests. The following test timeouts occurred in hadoop-hdfs-project/hadoop-hdfs:

          org.apache.hadoop.hdfs.tools.TestDFSAdminWithHA

          +1 contrib tests. The patch passed contrib unit tests.

          Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/8553//testReport/
          Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/8553//console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - -1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12677356/HDFS-6741.2.patch against trunk revision c05b581. +1 @author . The patch does not contain any @author tags. +1 tests included . The patch appears to include 2 new or modified test files. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . There were no new javadoc warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. -1 core tests . The following test timeouts occurred in hadoop-hdfs-project/hadoop-hdfs: org.apache.hadoop.hdfs.tools.TestDFSAdminWithHA +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/8553//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/8553//console This message is automatically generated.
          Hide
          Harsh J added a comment -

          Failed test appears unrelated. Manual run with patch passes, so the build problem was likely intermittent:

          Running org.apache.hadoop.hdfs.tools.TestDFSAdminWithHA
          Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 58.649 sec - in org.apache.hadoop.hdfs.tools.TestDFSAdminWithHA
          
          Results :
          
          Tests run: 10, Failures: 0, Errors: 0, Skipped: 0
          

          Build console appears truncated somehow for this test:

          Running org.apache.hadoop.hdfs.tools.TestDFSAdminWithHA
          estBlockMissingException
          

          Thank you for the new patch Stephen, sorry again for having duplicated the effort. I'll commit this in momentarily.

          Show
          Harsh J added a comment - Failed test appears unrelated. Manual run with patch passes, so the build problem was likely intermittent: Running org.apache.hadoop.hdfs.tools.TestDFSAdminWithHA Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 58.649 sec - in org.apache.hadoop.hdfs.tools.TestDFSAdminWithHA Results : Tests run: 10, Failures: 0, Errors: 0, Skipped: 0 Build console appears truncated somehow for this test: Running org.apache.hadoop.hdfs.tools.TestDFSAdminWithHA estBlockMissingException Thank you for the new patch Stephen, sorry again for having duplicated the effort. I'll commit this in momentarily.
          Hide
          Harsh J added a comment -

          Committed to branch-2 and trunk, thank you again Stephen!

          Show
          Harsh J added a comment - Committed to branch-2 and trunk, thank you again Stephen!
          Hide
          Stephen Chu added a comment -

          Thanks a lot, Harsh!

          Show
          Stephen Chu added a comment - Thanks a lot, Harsh!
          Hide
          Hudson added a comment -

          FAILURE: Integrated in Hadoop-trunk-Commit #6365 (See https://builds.apache.org/job/Hadoop-trunk-Commit/6365/)
          HDFS-6741. Improve permission denied message when FSPermissionChecker#checkOwner fails. Contributed by Stephen Chu and Harsh J. (harsh) (harsh: rev 0398db19b2c4558a9f08ac2700a27752748896fa)

          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSPermission.java
          • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java
          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSPermissionChecker.java
          Show
          Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #6365 (See https://builds.apache.org/job/Hadoop-trunk-Commit/6365/ ) HDFS-6741 . Improve permission denied message when FSPermissionChecker#checkOwner fails. Contributed by Stephen Chu and Harsh J. (harsh) (harsh: rev 0398db19b2c4558a9f08ac2700a27752748896fa) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSPermission.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSPermissionChecker.java
          Hide
          Hudson added a comment -

          SUCCESS: Integrated in Hadoop-Yarn-trunk #726 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/726/)
          HDFS-6741. Improve permission denied message when FSPermissionChecker#checkOwner fails. Contributed by Stephen Chu and Harsh J. (harsh) (harsh: rev 0398db19b2c4558a9f08ac2700a27752748896fa)

          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSPermissionChecker.java
          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSPermission.java
          • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java
          • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          Show
          Hudson added a comment - SUCCESS: Integrated in Hadoop-Yarn-trunk #726 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/726/ ) HDFS-6741 . Improve permission denied message when FSPermissionChecker#checkOwner fails. Contributed by Stephen Chu and Harsh J. (harsh) (harsh: rev 0398db19b2c4558a9f08ac2700a27752748896fa) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSPermissionChecker.java hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSPermission.java hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          Hide
          Hudson added a comment -

          FAILURE: Integrated in Hadoop-Mapreduce-trunk #1940 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1940/)
          HDFS-6741. Improve permission denied message when FSPermissionChecker#checkOwner fails. Contributed by Stephen Chu and Harsh J. (harsh) (harsh: rev 0398db19b2c4558a9f08ac2700a27752748896fa)

          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSPermissionChecker.java
          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSPermission.java
          • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java
          Show
          Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk #1940 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1940/ ) HDFS-6741 . Improve permission denied message when FSPermissionChecker#checkOwner fails. Contributed by Stephen Chu and Harsh J. (harsh) (harsh: rev 0398db19b2c4558a9f08ac2700a27752748896fa) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSPermissionChecker.java hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSPermission.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java
          Hide
          Hudson added a comment -

          SUCCESS: Integrated in Hadoop-Hdfs-trunk #1915 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1915/)
          HDFS-6741. Improve permission denied message when FSPermissionChecker#checkOwner fails. Contributed by Stephen Chu and Harsh J. (harsh) (harsh: rev 0398db19b2c4558a9f08ac2700a27752748896fa)

          • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSPermissionChecker.java
          • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java
          • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSPermission.java
          Show
          Hudson added a comment - SUCCESS: Integrated in Hadoop-Hdfs-trunk #1915 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1915/ ) HDFS-6741 . Improve permission denied message when FSPermissionChecker#checkOwner fails. Contributed by Stephen Chu and Harsh J. (harsh) (harsh: rev 0398db19b2c4558a9f08ac2700a27752748896fa) hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFSPermissionChecker.java hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSPermission.java

            People

            • Assignee:
              Harsh J
              Reporter:
              Stephen Chu
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development