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

CacheAdmin -listPools fails with NPE when user lacks permissions to view all pools

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0-alpha1
    • 2.3.0
    • caching, tools
    • None

    Description

      https://issues.apache.org/jira/browse/HDFS-5471 (CacheAdmin -listPools fails when user lacks permissions to view all pools) was recently resolved, but on a build with this fix, I am running into another error when using cacheadmin -listPools.

      Now, when the user does not have permissions to view all the pools, the cacheadmin -listPools command will throw a NullPointerException.

      On a system with a single pool "root" with a mode of 750, I see this as user schu:

      [schu@hdfs-c5-nfs ~]$ hdfs cacheadmin -listPools
      Exception in thread "main" java.lang.NullPointerException
      	at org.apache.hadoop.hdfs.tools.CacheAdmin$ListCachePoolsCommand.run(CacheAdmin.java:745)
      	at org.apache.hadoop.hdfs.tools.CacheAdmin.run(CacheAdmin.java:82)
      	at org.apache.hadoop.hdfs.tools.CacheAdmin.main(CacheAdmin.java:87)
      

      After we modify the root pool to 755, then -listPools works properly.

      [schu@hdfs-c5-nfs ~]$ hdfs cacheadmin -listPools
      Found 1 result.
      NAME  OWNER  GROUP  MODE       WEIGHT 
      root  root   root   rwxr-xr-x  100    
      [schu@hdfs-c5-nfs ~]$ 
      

      Attachments

        1. hdfs-5512-1.patch
          2 kB
          Andrew Wang

        Activity

          People

            andrew.wang Andrew Wang
            schu Stephen Chu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: