Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-9019

Adding informative message to sticky bit permission denied exception

    Details

    • Hadoop Flags:
      Reviewed

      Description

      The check for sticky bit permission in FSPermissionChecker.java prints only the child file name and the current owner.
      It does not print the owner of the file and the parent directory. It would help to have that printed as well for ease of debugging permission issues.

      1. HDFS-9019.001.patch
        3 kB
        Xiaoyu Yao
      2. HDFS-9019.000.patch
        1 kB
        Xiaoyu Yao

        Activity

        Hide
        thejas Thejas M Nair added a comment -

        The relavent function -

         private void checkStickyBit(INodeAttributes parent, INodeAttributes inode
              ) throws AccessControlException {
            if (!parent.getFsPermission().getStickyBit()) {
              return;
            }
        
            // If this user is the directory owner, return
            if (parent.getUserName().equals(getUser())) {
              return;
            }
        
            // if this user is the file owner, return
            if (inode.getUserName().equals(getUser())) {
              return;
            }
        
            throw new AccessControlException("Permission denied by sticky bit setting:" +
              " user=" + getUser() + ", inode=" + inode);
          }
        
        Show
        thejas Thejas M Nair added a comment - The relavent function - private void checkStickyBit(INodeAttributes parent, INodeAttributes inode ) throws AccessControlException { if (!parent.getFsPermission().getStickyBit()) { return ; } // If this user is the directory owner, return if (parent.getUserName().equals(getUser())) { return ; } // if this user is the file owner, return if (inode.getUserName().equals(getUser())) { return ; } throw new AccessControlException( "Permission denied by sticky bit setting:" + " user=" + getUser() + ", inode=" + inode); }
        Hide
        thejas Thejas M Nair added a comment -

        Above exception should include 3 more things for ease of debugging -
        parent.getUserName() , inode.getUserName() and parent.

        Sometimes the files get deleted before debugging can happen, so printing the file usernames(owner name) also helps

        Show
        thejas Thejas M Nair added a comment - Above exception should include 3 more things for ease of debugging - parent.getUserName() , inode.getUserName() and parent. Sometimes the files get deleted before debugging can happen, so printing the file usernames(owner name) also helps
        Hide
        xyao Xiaoyu Yao added a comment -

        Thanks Thejas M Nair for reporting the issue. Attach a patch adding additional inode and its parent info to AccessControlException message.

        Show
        xyao Xiaoyu Yao added a comment - Thanks Thejas M Nair for reporting the issue. Attach a patch adding additional inode and its parent info to AccessControlException message.
        Hide
        hadoopqa Hadoop QA added a comment -



        -1 overall



        Vote Subsystem Runtime Comment
        0 pre-patch 19m 44s Pre-patch trunk compilation is healthy.
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 tests included 0m 0s 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 8m 49s There were no new javac warning messages.
        +1 javadoc 11m 2s There were no new javadoc warning messages.
        +1 release audit 0m 24s The applied patch does not increase the total number of release audit warnings.
        +1 checkstyle 1m 38s There were no new checkstyle issues.
        +1 whitespace 0m 0s The patch has no lines that end in whitespace.
        +1 install 1m 38s mvn install still works.
        +1 eclipse:eclipse 0m 37s The patch built with eclipse:eclipse.
        +1 findbugs 2m 51s The patch does not introduce any new Findbugs (version 3.0.0) warnings.
        +1 native 3m 35s Pre-build of native portion
        -1 hdfs tests 168m 58s Tests failed in hadoop-hdfs.
            219m 18s  



        Reason Tests
        Failed unit tests hadoop.hdfs.server.namenode.TestFSNamesystem
          hadoop.hdfs.server.datanode.TestFsDatasetCache



        Subsystem Report/Notes
        Patch URL http://issues.apache.org/jira/secure/attachment/12754093/HDFS-9019.000.patch
        Optional Tests javadoc javac unit findbugs checkstyle
        git revision trunk / ed78b14
        hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/12294/artifact/patchprocess/testrun_hadoop-hdfs.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/12294/testReport/
        Java 1.7.0_55
        uname Linux asf902.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/12294/console

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 pre-patch 19m 44s Pre-patch trunk compilation is healthy. +1 @author 0m 0s The patch does not contain any @author tags. -1 tests included 0m 0s 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 8m 49s There were no new javac warning messages. +1 javadoc 11m 2s There were no new javadoc warning messages. +1 release audit 0m 24s The applied patch does not increase the total number of release audit warnings. +1 checkstyle 1m 38s There were no new checkstyle issues. +1 whitespace 0m 0s The patch has no lines that end in whitespace. +1 install 1m 38s mvn install still works. +1 eclipse:eclipse 0m 37s The patch built with eclipse:eclipse. +1 findbugs 2m 51s The patch does not introduce any new Findbugs (version 3.0.0) warnings. +1 native 3m 35s Pre-build of native portion -1 hdfs tests 168m 58s Tests failed in hadoop-hdfs.     219m 18s   Reason Tests Failed unit tests hadoop.hdfs.server.namenode.TestFSNamesystem   hadoop.hdfs.server.datanode.TestFsDatasetCache Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12754093/HDFS-9019.000.patch Optional Tests javadoc javac unit findbugs checkstyle git revision trunk / ed78b14 hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/12294/artifact/patchprocess/testrun_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/12294/testReport/ Java 1.7.0_55 uname Linux asf902.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Console output https://builds.apache.org/job/PreCommit-HDFS-Build/12294/console This message was automatically generated.
        Hide
        szetszwo Tsz Wo Nicholas Sze added a comment -

        Let's use colon notation to print user:group:mode and print out full path for the inode and its parent; see toAccessControlString(..).

        Show
        szetszwo Tsz Wo Nicholas Sze added a comment - Let's use colon notation to print user:group:mode and print out full path for the inode and its parent; see toAccessControlString(..).
        Hide
        xyao Xiaoyu Yao added a comment -

        Thanks Tsz Wo Nicholas Sze for reviewing. Patch v001 addresses your comments with unit tests. Sample exception message from unit test output:

        2015-09-04 11:16:49,111 [IPC Server handler 6 on 57099] INFO  ipc.Server (Server.java:run(2244)) - IPC Server handler 6 on 57099, call org.apache.hadoop.hdfs.protocol.ClientProtocol.delete from 127.0.0.1:57122 Call#65 Retry#0: org.apache.hadoop.security.AccessControlException: Permission denied by sticky bit: user=rose, path="/tennant/contemporary/foo":theDoctor:supergroup:-rw-r--r--, parent="/tennant/contemporary":xyao:supergroup:drwxrwxrwt
        
        Show
        xyao Xiaoyu Yao added a comment - Thanks Tsz Wo Nicholas Sze for reviewing. Patch v001 addresses your comments with unit tests. Sample exception message from unit test output: 2015-09-04 11:16:49,111 [IPC Server handler 6 on 57099] INFO  ipc.Server (Server.java:run(2244)) - IPC Server handler 6 on 57099, call org.apache.hadoop.hdfs.protocol.ClientProtocol.delete from 127.0.0.1:57122 Call#65 Retry#0: org.apache.hadoop.security.AccessControlException: Permission denied by sticky bit: user=rose, path= "/tennant/contemporary/foo" :theDoctor:supergroup:-rw-r--r--, parent= "/tennant/contemporary" :xyao:supergroup:drwxrwxrwt
        Hide
        hadoopqa Hadoop QA added a comment -



        -1 overall



        Vote Subsystem Runtime Comment
        -1 pre-patch 15m 44s Findbugs (version ) appears to be broken on trunk.
        +1 @author 0m 0s The patch does not contain any @author tags.
        +1 tests included 0m 0s The patch appears to include 1 new or modified test files.
        +1 javac 7m 59s There were no new javac warning messages.
        +1 javadoc 10m 0s There were no new javadoc warning messages.
        +1 release audit 0m 23s The applied patch does not increase the total number of release audit warnings.
        +1 checkstyle 0m 31s There were no new checkstyle issues.
        +1 whitespace 0m 0s The patch has no lines that end in whitespace.
        +1 install 1m 33s mvn install still works.
        +1 eclipse:eclipse 0m 34s The patch built with eclipse:eclipse.
        +1 findbugs 2m 30s The patch does not introduce any new Findbugs (version 3.0.0) warnings.
        +1 native 3m 9s Pre-build of native portion
        -1 hdfs tests 74m 59s Tests failed in hadoop-hdfs.
            117m 25s  



        Reason Tests
        Timed out tests org.apache.hadoop.hdfs.TestPersistBlocks



        Subsystem Report/Notes
        Patch URL http://issues.apache.org/jira/secure/attachment/12754241/HDFS-9019.001.patch
        Optional Tests javadoc javac unit findbugs checkstyle
        git revision trunk / 30db1ad
        hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/12313/artifact/patchprocess/testrun_hadoop-hdfs.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/12313/testReport/
        Java 1.7.0_55
        uname Linux asf907.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/12313/console

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment -1 pre-patch 15m 44s Findbugs (version ) appears to be broken on trunk. +1 @author 0m 0s The patch does not contain any @author tags. +1 tests included 0m 0s The patch appears to include 1 new or modified test files. +1 javac 7m 59s There were no new javac warning messages. +1 javadoc 10m 0s There were no new javadoc warning messages. +1 release audit 0m 23s The applied patch does not increase the total number of release audit warnings. +1 checkstyle 0m 31s There were no new checkstyle issues. +1 whitespace 0m 0s The patch has no lines that end in whitespace. +1 install 1m 33s mvn install still works. +1 eclipse:eclipse 0m 34s The patch built with eclipse:eclipse. +1 findbugs 2m 30s The patch does not introduce any new Findbugs (version 3.0.0) warnings. +1 native 3m 9s Pre-build of native portion -1 hdfs tests 74m 59s Tests failed in hadoop-hdfs.     117m 25s   Reason Tests Timed out tests org.apache.hadoop.hdfs.TestPersistBlocks Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12754241/HDFS-9019.001.patch Optional Tests javadoc javac unit findbugs checkstyle git revision trunk / 30db1ad hadoop-hdfs test log https://builds.apache.org/job/PreCommit-HDFS-Build/12313/artifact/patchprocess/testrun_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/12313/testReport/ Java 1.7.0_55 uname Linux asf907.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Console output https://builds.apache.org/job/PreCommit-HDFS-Build/12313/console This message was automatically generated.
        Hide
        szetszwo Tsz Wo Nicholas Sze added a comment -

        +1 the new patch looks good. Thanks.

        Show
        szetszwo Tsz Wo Nicholas Sze added a comment - +1 the new patch looks good. Thanks.
        Hide
        xyao Xiaoyu Yao added a comment -

        Thanks Tsz Wo Nicholas Sze for the review. I've committed the patch to trunk and branch-2.

        Show
        xyao Xiaoyu Yao added a comment - Thanks Tsz Wo Nicholas Sze for the review. I've committed the patch to trunk and branch-2.
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-trunk-Commit #8415 (See https://builds.apache.org/job/Hadoop-trunk-Commit/8415/)
        HDFS-9019. Adding informative message to sticky bit permission denied exception. Contributed by Xiaoyu Yao. (xyao: rev 970daaa5e44d3c09afd46d1c8e923a5096708c44)

        • 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/fs/permission/TestStickyBit.java
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #8415 (See https://builds.apache.org/job/Hadoop-trunk-Commit/8415/ ) HDFS-9019 . Adding informative message to sticky bit permission denied exception. Contributed by Xiaoyu Yao. (xyao: rev 970daaa5e44d3c09afd46d1c8e923a5096708c44) 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/fs/permission/TestStickyBit.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #363 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/363/)
        HDFS-9019. Adding informative message to sticky bit permission denied exception. Contributed by Xiaoyu Yao. (xyao: rev 970daaa5e44d3c09afd46d1c8e923a5096708c44)

        • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/permission/TestStickyBit.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 Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #363 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/363/ ) HDFS-9019 . Adding informative message to sticky bit permission denied exception. Contributed by Xiaoyu Yao. (xyao: rev 970daaa5e44d3c09afd46d1c8e923a5096708c44) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/permission/TestStickyBit.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 Hudson added a comment -

        FAILURE: Integrated in Hadoop-Yarn-trunk #1094 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/1094/)
        HDFS-9019. Adding informative message to sticky bit permission denied exception. Contributed by Xiaoyu Yao. (xyao: rev 970daaa5e44d3c09afd46d1c8e923a5096708c44)

        • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/permission/TestStickyBit.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 Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk #1094 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/1094/ ) HDFS-9019 . Adding informative message to sticky bit permission denied exception. Contributed by Xiaoyu Yao. (xyao: rev 970daaa5e44d3c09afd46d1c8e923a5096708c44) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/permission/TestStickyBit.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 Hudson added a comment -

        FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #356 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/356/)
        HDFS-9019. Adding informative message to sticky bit permission denied exception. Contributed by Xiaoyu Yao. (xyao: rev 970daaa5e44d3c09afd46d1c8e923a5096708c44)

        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/permission/TestStickyBit.java
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #356 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/356/ ) HDFS-9019 . Adding informative message to sticky bit permission denied exception. Contributed by Xiaoyu Yao. (xyao: rev 970daaa5e44d3c09afd46d1c8e923a5096708c44) hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/permission/TestStickyBit.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Mapreduce-trunk #2306 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2306/)
        HDFS-9019. Adding informative message to sticky bit permission denied exception. Contributed by Xiaoyu Yao. (xyao: rev 970daaa5e44d3c09afd46d1c8e923a5096708c44)

        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/permission/TestStickyBit.java
        • hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Mapreduce-trunk #2306 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2306/ ) HDFS-9019 . Adding informative message to sticky bit permission denied exception. Contributed by Xiaoyu Yao. (xyao: rev 970daaa5e44d3c09afd46d1c8e923a5096708c44) hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/permission/TestStickyBit.java hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #344 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/344/)
        HDFS-9019. Adding informative message to sticky bit permission denied exception. Contributed by Xiaoyu Yao. (xyao: rev 970daaa5e44d3c09afd46d1c8e923a5096708c44)

        • 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/fs/permission/TestStickyBit.java
        • hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #344 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/344/ ) HDFS-9019 . Adding informative message to sticky bit permission denied exception. Contributed by Xiaoyu Yao. (xyao: rev 970daaa5e44d3c09afd46d1c8e923a5096708c44) 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/fs/permission/TestStickyBit.java hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk #2283 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2283/)
        HDFS-9019. Adding informative message to sticky bit permission denied exception. Contributed by Xiaoyu Yao. (xyao: rev 970daaa5e44d3c09afd46d1c8e923a5096708c44)

        • hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/permission/TestStickyBit.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 Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk #2283 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2283/ ) HDFS-9019 . Adding informative message to sticky bit permission denied exception. Contributed by Xiaoyu Yao. (xyao: rev 970daaa5e44d3c09afd46d1c8e923a5096708c44) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/permission/TestStickyBit.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
        zhz Zhe Zhang added a comment -

        Thanks for the work Xiaoyu Yao. Since affect version includes 2.7 (and I think this is a valid improvement for 2.7), I just did the backport.

        Show
        zhz Zhe Zhang added a comment - Thanks for the work Xiaoyu Yao . Since affect version includes 2.7 (and I think this is a valid improvement for 2.7), I just did the backport.

          People

          • Assignee:
            xyao Xiaoyu Yao
            Reporter:
            thejas Thejas M Nair
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development