Hadoop Common
  1. Hadoop Common
  2. HADOOP-4526

fsck failing with NullPointerException (return value 0)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.18.1
    • Fix Version/s: 0.18.2
    • Component/s: None
    • Labels:
      None
    • Environment:

      0.18.1_H4277_H4271_H4326_H4314_H4395_H4351_H4407_H3217

    • Hadoop Flags:
      Reviewed

      Description

      fsck is siliently dying with return value of 0.

      Namenode log showing
      2008-10-27 07:57:00,514 WARN /: /fsck?path=%2F:
      java.lang.NullPointerException

      No stack trace.

      1. fsckNPE.patch
        0.7 kB
        Hairong Kuang
      2. fsckNPE-br18.patch
        0.6 kB
        Hairong Kuang

        Activity

        Hide
        Koji Noguchi added a comment -

        Reproduced the problem on a singlenode cluster by inserting some sleep.
        Very similar issue with HADOOP-3107.
        It somehow prints out the full stacktrace to the log only when there's no successful fsck before that.
        (I believe it's an uncaught exception)

        2008-10-27 21:50:17,285 WARN /: /fsck?path=%2Fuser:
        java.lang.NullPointerException
          at org.apache.hadoop.dfs.NamenodeFsck.check(NamenodeFsck.java:172)
          at org.apache.hadoop.dfs.NamenodeFsck.check(NamenodeFsck.java:166)
          at org.apache.hadoop.dfs.NamenodeFsck.fsck(NamenodeFsck.java:129)
          at org.apache.hadoop.dfs.FsckServlet.doGet(FsckServlet.java:48)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
          at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
          at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:475)
          at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
          at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
          at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:635)
          at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
          at org.mortbay.http.HttpServer.service(HttpServer.java:954)
          at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
          at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
          at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
          at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
          at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
          at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
        
        NamenodeFsck.java
        171     LocatedBlocks blocks = nn.namesystem.getBlockLocations(path, 0, fileLen);
        172     isOpen = blocks.isUnderConstruction();
        
        Show
        Koji Noguchi added a comment - Reproduced the problem on a singlenode cluster by inserting some sleep. Very similar issue with HADOOP-3107 . It somehow prints out the full stacktrace to the log only when there's no successful fsck before that. (I believe it's an uncaught exception) 2008-10-27 21:50:17,285 WARN /: /fsck?path=%2Fuser: java.lang.NullPointerException at org.apache.hadoop.dfs.NamenodeFsck.check(NamenodeFsck.java:172) at org.apache.hadoop.dfs.NamenodeFsck.check(NamenodeFsck.java:166) at org.apache.hadoop.dfs.NamenodeFsck.fsck(NamenodeFsck.java:129) at org.apache.hadoop.dfs.FsckServlet.doGet(FsckServlet.java:48) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:475) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567) at org.mortbay.http.HttpContext.handle(HttpContext.java:1565) at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:635) at org.mortbay.http.HttpContext.handle(HttpContext.java:1517) at org.mortbay.http.HttpServer.service(HttpServer.java:954) at org.mortbay.http.HttpConnection.service(HttpConnection.java:814) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534) NamenodeFsck.java 171 LocatedBlocks blocks = nn.namesystem.getBlockLocations(path, 0, fileLen); 172 isOpen = blocks.isUnderConstruction();
        Hide
        Hairong Kuang added a comment -

        This simple patch fixes the NPE problem.

        Show
        Hairong Kuang added a comment - This simple patch fixes the NPE problem.
        Hide
        Konstantin Shvachko added a comment -

        +1
        We generally accept files with no blocks. It should be reflected in fsck.

        Show
        Konstantin Shvachko added a comment - +1 We generally accept files with no blocks. It should be reflected in fsck.
        Hide
        Hairong Kuang added a comment -

        I ran anttest-core on the patch on my local machine. The build was successfully finished.

        Here was the result of ant test-patch:

        [exec] -1 overall.

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

        [exec] -1 tests included. The patch doesn't appear to include anynew or modified tests.
        [exec] Please justify why no tests are needed for this patch.

        [exec] +1 javadoc. The javadoc tool did not generate any warning messages.

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

        [exec] +1 findbugs. The patch does not introduce any new Findbugswarnings.

        [exec] +1 Eclipse classpath. The patch retains Eclipse classpath integrity.

        I have manually tested the patch and it showed the patch solved the NPE problem.

        Show
        Hairong Kuang added a comment - I ran anttest-core on the patch on my local machine. The build was successfully finished. Here was the result of ant test-patch: [exec] -1 overall. [exec] +1 @author. The patch does not contain any @author tags. [exec] -1 tests included. The patch doesn't appear to include anynew or modified tests. [exec] Please justify why no tests are needed for this patch. [exec] +1 javadoc. The javadoc tool did not generate any warning messages. [exec] +1 javac. The applied patch does not increase the total number of javac compiler warnings. [exec] +1 findbugs. The patch does not introduce any new Findbugswarnings. [exec] +1 Eclipse classpath. The patch retains Eclipse classpath integrity. I have manually tested the patch and it showed the patch solved the NPE problem.
        Hide
        Hairong Kuang added a comment -

        The patch for branch 0.18.

        Show
        Hairong Kuang added a comment - The patch for branch 0.18.
        Hide
        Hairong Kuang added a comment -

        I just committed this.

        Show
        Hairong Kuang added a comment - I just committed this.
        Hide
        Hudson added a comment -

        Integrated in Hadoop-trunk #646 (See http://hudson.zones.apache.org/hudson/job/Hadoop-trunk/646/)
        . fsck failing with NullPointerException. Contributed by Hairong Kuang.

        Show
        Hudson added a comment - Integrated in Hadoop-trunk #646 (See http://hudson.zones.apache.org/hudson/job/Hadoop-trunk/646/ ) . fsck failing with NullPointerException. Contributed by Hairong Kuang.

          People

          • Assignee:
            Hairong Kuang
            Reporter:
            Koji Noguchi
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development