Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-3434

InvalidProtocolBufferException when visiting DN browseDirectory.jsp

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-alpha
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Target Version/s:

      Description

      The nnaddr field on dfsnodelist.jsp is getting set incorrectly. When selecting the "haus04" under the "Node" table I get a link with the http address which is bogus (the wildcard/http port not the nn rpc addr), which results in an error of "Call From haus04.mtv.cloudera.com/172.29.122.94 to 0.0.0.0:10070 failed on connection exception: java.net.ConnectException: Connection refused". The browse this file system link works.

      1. hdfs-3434.txt
        2 kB
        Eli Collins
      2. hdfs-3434.txt
        1 kB
        Eli Collins
      3. hdfs-3434.txt
        12 kB
        Eli Collins

        Issue Links

          Activity

          Hide
          Hudson added a comment -

          Integrated in Hadoop-Mapreduce-trunk #1083 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1083/)
          HDFS-3434. InvalidProtocolBufferException when visiting DN browseDirectory.jsp. Contributed by Eli Collins (Revision 1339712)

          Result = SUCCESS
          eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1339712
          Files :

          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/common/TestJspHelper.java
          Show
          Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk #1083 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1083/ ) HDFS-3434 . InvalidProtocolBufferException when visiting DN browseDirectory.jsp. Contributed by Eli Collins (Revision 1339712) Result = SUCCESS eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1339712 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/common/TestJspHelper.java
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Hdfs-trunk #1049 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1049/)
          HDFS-3434. InvalidProtocolBufferException when visiting DN browseDirectory.jsp. Contributed by Eli Collins (Revision 1339712)

          Result = SUCCESS
          eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1339712
          Files :

          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/common/TestJspHelper.java
          Show
          Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #1049 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1049/ ) HDFS-3434 . InvalidProtocolBufferException when visiting DN browseDirectory.jsp. Contributed by Eli Collins (Revision 1339712) Result = SUCCESS eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1339712 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/common/TestJspHelper.java
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Mapreduce-trunk-Commit #2279 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/2279/)
          HDFS-3434. InvalidProtocolBufferException when visiting DN browseDirectory.jsp. Contributed by Eli Collins (Revision 1339712)

          Result = ABORTED
          eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1339712
          Files :

          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/common/TestJspHelper.java
          Show
          Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk-Commit #2279 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/2279/ ) HDFS-3434 . InvalidProtocolBufferException when visiting DN browseDirectory.jsp. Contributed by Eli Collins (Revision 1339712) Result = ABORTED eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1339712 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/common/TestJspHelper.java
          Hide
          Eli Collins added a comment -

          Thanks Todd. I've committed this to trunk and merged to branch-2. Filed HDFS-3437 for removing name.node.address.

          Show
          Eli Collins added a comment - Thanks Todd. I've committed this to trunk and merged to branch-2. Filed HDFS-3437 for removing name.node.address.
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Common-trunk-Commit #2262 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/2262/)
          HDFS-3434. InvalidProtocolBufferException when visiting DN browseDirectory.jsp. Contributed by Eli Collins (Revision 1339712)

          Result = SUCCESS
          eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1339712
          Files :

          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/common/TestJspHelper.java
          Show
          Hudson added a comment - Integrated in Hadoop-Common-trunk-Commit #2262 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/2262/ ) HDFS-3434 . InvalidProtocolBufferException when visiting DN browseDirectory.jsp. Contributed by Eli Collins (Revision 1339712) Result = SUCCESS eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1339712 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/common/TestJspHelper.java
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Hdfs-trunk-Commit #2335 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/2335/)
          HDFS-3434. InvalidProtocolBufferException when visiting DN browseDirectory.jsp. Contributed by Eli Collins (Revision 1339712)

          Result = SUCCESS
          eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1339712
          Files :

          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/common/TestJspHelper.java
          Show
          Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #2335 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/2335/ ) HDFS-3434 . InvalidProtocolBufferException when visiting DN browseDirectory.jsp. Contributed by Eli Collins (Revision 1339712) Result = SUCCESS eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1339712 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeHttpServer.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/common/TestJspHelper.java
          Hide
          Todd Lipcon added a comment -

          lgtm +1

          Show
          Todd Lipcon added a comment - lgtm +1
          Hide
          Hadoop QA added a comment -

          +1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12527762/hdfs-3434.txt
          against trunk revision .

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

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

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

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

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

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

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

          +1 core tests. The patch passed unit tests in hadoop-hdfs-project/hadoop-hdfs.

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

          Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/2454//testReport/
          Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/2454//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/12527762/hdfs-3434.txt against trunk revision . +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 1 new or modified test files. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 javadoc. The javadoc tool did not generate any warning messages. +1 eclipse:eclipse. The patch built with eclipse:eclipse. +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed unit tests in hadoop-hdfs-project/hadoop-hdfs. +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/2454//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/2454//console This message is automatically generated.
          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12527761/hdfs-3434.txt
          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. The javadoc tool did not generate any warning messages.

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

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

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

          +1 core tests. The patch passed unit tests in hadoop-hdfs-project/hadoop-hdfs.

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

          Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/2453//testReport/
          Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/2453//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/12527761/hdfs-3434.txt 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. The javadoc tool did not generate any warning messages. +1 eclipse:eclipse. The patch built with eclipse:eclipse. +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed unit tests in hadoop-hdfs-project/hadoop-hdfs. +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/2453//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/2453//console This message is automatically generated.
          Hide
          Eli Collins added a comment -

          Same minimal patch but I noticed from the output of the test run of the previous patch that verifyServiceInToken should pass "expected" as the first param.

          Show
          Eli Collins added a comment - Same minimal patch but I noticed from the output of the test run of the previous patch that verifyServiceInToken should pass "expected" as the first param.
          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12527751/hdfs-3434.txt
          against trunk revision .

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

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

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

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

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

          +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) 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.server.common.TestJspHelper

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

          Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/2452//testReport/
          Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/2452//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/12527751/hdfs-3434.txt against trunk revision . +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 1 new or modified test files. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 javadoc. The javadoc tool did not generate any warning messages. +1 eclipse:eclipse. The patch built with eclipse:eclipse. +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) 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.server.common.TestJspHelper +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/2452//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/2452//console This message is automatically generated.
          Hide
          Eli Collins added a comment -

          Here's a minimal fix.

          Per the previous change I think we can probably do away with name.node.address entirely and always use NameNodeHttpServer.getNameNodeFromContext since we always create NN proxies from within the NN. Perhaps better to do as a separate change.

          Show
          Eli Collins added a comment - Here's a minimal fix. Per the previous change I think we can probably do away with name.node.address entirely and always use NameNodeHttpServer.getNameNodeFromContext since we always create NN proxies from within the NN. Perhaps better to do as a separate change.
          Hide
          Eli Collins added a comment -

          This was broken by HDFS-2617, which changed the following:

          -          httpServer.setAttribute(NAMENODE_ADDRESS_ATTRIBUTE_KEY,
          -              nn.getNameNodeAddress());
          +    httpServer.setAttribute("name.node.address", bindAddress);
          
          Show
          Eli Collins added a comment - This was broken by HDFS-2617 , which changed the following: - httpServer.setAttribute(NAMENODE_ADDRESS_ATTRIBUTE_KEY, - nn.getNameNodeAddress()); + httpServer.setAttribute( "name.node.address" , bindAddress);
          Hide
          Eli Collins added a comment -

          Forgot to mention, I verified that with this change the links under "Node" now work on the web UI (no more InvalidProtocolBufferException exception) because they're getting passed the NN RPC address now instead of the Http address.

          Show
          Eli Collins added a comment - Forgot to mention, I verified that with this change the links under "Node" now work on the web UI (no more InvalidProtocolBufferException exception) because they're getting passed the NN RPC address now instead of the Http address.
          Hide
          Eli Collins added a comment -

          Patch attached. The core of the fix is here:

          -      InetSocketAddress nnSocketAddress = (InetSocketAddress) context
          -          .getAttribute(NameNodeHttpServer.NAMENODE_ADDRESS_ATTRIBUTE_KEY);
          -      String nnaddr = nnSocketAddress.getAddress().getHostAddress() + ":"
          -          + nnSocketAddress.getPort();
          -
          +      String nnaddr = NetUtils.getHostPortString(nn.getNameNodeAddress());
          

          NAMENODE_ADDRESS_ATTRIBUTE_KEY contains the http bind address, it should never be used to create a NN rpc connection, I've removed it entirely. Eg DfsServlet#createNameNodeProxy is always called from w/in the NN, think this is dead code. Looks like this was introduced in HDFS-1709.

          Show
          Eli Collins added a comment - Patch attached. The core of the fix is here: - InetSocketAddress nnSocketAddress = (InetSocketAddress) context - .getAttribute(NameNodeHttpServer.NAMENODE_ADDRESS_ATTRIBUTE_KEY); - String nnaddr = nnSocketAddress.getAddress().getHostAddress() + ":" - + nnSocketAddress.getPort(); - + String nnaddr = NetUtils.getHostPortString(nn.getNameNodeAddress()); NAMENODE_ADDRESS_ATTRIBUTE_KEY contains the http bind address, it should never be used to create a NN rpc connection, I've removed it entirely. Eg DfsServlet#createNameNodeProxy is always called from w/in the NN, think this is dead code. Looks like this was introduced in HDFS-1709 .

            People

            • Assignee:
              Eli Collins
              Reporter:
              Eli Collins
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development