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

fsck command should not print exception trace when file not found

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.8.0, 3.0.0-alpha1
    • None
    • None

    Description

      when file doesnt exist fsck throws exception

      ./hdfs fsck /kiran
      

      the following exception occurs

      WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
      FileSystem is inaccessible due to:
      java.io.FileNotFoundException: File does not exist: /kiran
              at org.apache.hadoop.hdfs.DistributedFileSystem$23.doCall(DistributedFileSystem.java:1273)
              at org.apache.hadoop.hdfs.DistributedFileSystem$23.doCall(DistributedFileSystem.java:1265)
              at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
              at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:1265)
              at org.apache.hadoop.fs.FileSystem.resolvePath(FileSystem.java:755)
              at org.apache.hadoop.hdfs.tools.DFSck.getResolvedPath(DFSck.java:236)
              at org.apache.hadoop.hdfs.tools.DFSck.doWork(DFSck.java:316)
              at org.apache.hadoop.hdfs.tools.DFSck.access$000(DFSck.java:73)
              at org.apache.hadoop.hdfs.tools.DFSck$1.run(DFSck.java:155)
              at org.apache.hadoop.hdfs.tools.DFSck$1.run(DFSck.java:152)
              at java.security.AccessController.doPrivileged(Native Method)
              at javax.security.auth.Subject.doAs(Subject.java:422)
              at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1667)
              at org.apache.hadoop.hdfs.tools.DFSck.run(DFSck.java:151)
              at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
              at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)
              at org.apache.hadoop.hdfs.tools.DFSck.main(DFSck.java:383)
      

      but only

      {code }

      File does not exist: /kiran

       error message should be thrown
      
      

      } catch (IOException ioe) {
      System.err.println("FileSystem is inaccessible due to:\n"
      + StringUtils.stringifyException(ioe));
      }

      i think it should use ioe.getmessage() method
      
      

      } catch (IOException ioe)

      { System.err.println("FileSystem is inaccessible due to:\n" + StringUtils.stringifyException(ioe.getmessage())); } {code}

      Attachments

        1. HDFS-9284_00.patch
          0.9 kB
          Jagadesh Kiran N
        2. HDFS-9284_01.patch
          1 kB
          Jagadesh Kiran N
        3. HDFS-9284_02.patch
          1 kB
          Jagadesh Kiran N

        Activity

          People

            jagadesh.kiran Jagadesh Kiran N
            jagadesh.kiran Jagadesh Kiran N
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: