Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-2025

Go Back to File View link is not working in tail.jsp

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.23.0
    • Fix Version/s: 3.0.0, 2.0.2-alpha
    • Component/s: datanode
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      While browsing the file system.
      Click on any file link to go to the page where the file contents are displayed, then when we click on 'Tail this file' link.
      The control will go to the tail.jsp here when we
      Click on 'Go Back to File View' option.
      HTTP Error page not found will come.

      This is because the referrer URL is encoded and the encoded URL is itself being used in the 'Go Back to File View' hyperlink which will be treated as a relative URL and thus the HTTP request will fail.

      1. HDFS-2025.patch
        1 kB
        sravankorumilli
      2. HDFS-2025_5.patch
        6 kB
        Ashish Singhi
      3. HDFS-2025_4.patch
        6 kB
        sravankorumilli
      4. HDFS-2025_3.patch
        6 kB
        sravankorumilli
      5. HDFS-2025_2.patch
        6 kB
        sravankorumilli
      6. HDFS-2025_1.patch
        1 kB
        sravankorumilli
      7. ASF.LICENSE.NOT.GRANTED--ScreenShot_1.jpg
        62 kB
        sravankorumilli

        Activity

        Arun C Murthy made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Arun C Murthy made changes -
        Fix Version/s 2.0.2-alpha [ 12322472 ]
        Fix Version/s 2.1.0-alpha [ 12321440 ]
        Hide
        Ashish Singhi added a comment -

        Thanks a lot Daryn and Uma!

        Show
        Ashish Singhi added a comment - Thanks a lot Daryn and Uma!
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk #1099 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1099/)
        HDFS-2025. Go Back to File View link is not working in tail.jsp. Contributed by Ashish and Sravan. (Revision 1345563)

        Result = FAILURE
        umamahesh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1345563
        Files :

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DatanodeJspHelper.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDatanodeJsp.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk #1099 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1099/ ) HDFS-2025 . Go Back to File View link is not working in tail.jsp. Contributed by Ashish and Sravan. (Revision 1345563) Result = FAILURE umamahesh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1345563 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DatanodeJspHelper.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDatanodeJsp.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk #1065 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1065/)
        HDFS-2025. Go Back to File View link is not working in tail.jsp. Contributed by Ashish and Sravan. (Revision 1345563)

        Result = FAILURE
        umamahesh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1345563
        Files :

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DatanodeJspHelper.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDatanodeJsp.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #1065 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1065/ ) HDFS-2025 . Go Back to File View link is not working in tail.jsp. Contributed by Ashish and Sravan. (Revision 1345563) Result = FAILURE umamahesh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1345563 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DatanodeJspHelper.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDatanodeJsp.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk-Commit #2333 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/2333/)
        HDFS-2025. Go Back to File View link is not working in tail.jsp. Contributed by Ashish and Sravan. (Revision 1345563)

        Result = FAILURE
        umamahesh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1345563
        Files :

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DatanodeJspHelper.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDatanodeJsp.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk-Commit #2333 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/2333/ ) HDFS-2025 . Go Back to File View link is not working in tail.jsp. Contributed by Ashish and Sravan. (Revision 1345563) Result = FAILURE umamahesh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1345563 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DatanodeJspHelper.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDatanodeJsp.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Common-trunk-Commit #2315 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/2315/)
        HDFS-2025. Go Back to File View link is not working in tail.jsp. Contributed by Ashish and Sravan. (Revision 1345563)

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

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DatanodeJspHelper.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDatanodeJsp.java
        Show
        Hudson added a comment - Integrated in Hadoop-Common-trunk-Commit #2315 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/2315/ ) HDFS-2025 . Go Back to File View link is not working in tail.jsp. Contributed by Ashish and Sravan. (Revision 1345563) Result = SUCCESS umamahesh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1345563 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DatanodeJspHelper.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDatanodeJsp.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk-Commit #2387 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/2387/)
        HDFS-2025. Go Back to File View link is not working in tail.jsp. Contributed by Ashish and Sravan. (Revision 1345563)

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

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DatanodeJspHelper.java
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDatanodeJsp.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #2387 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/2387/ ) HDFS-2025 . Go Back to File View link is not working in tail.jsp. Contributed by Ashish and Sravan. (Revision 1345563) Result = SUCCESS umamahesh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1345563 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DatanodeJspHelper.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDatanodeJsp.java
        Uma Maheswara Rao G made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags Reviewed [ 10343 ]
        Fix Version/s 2.0.1-alpha [ 12321440 ]
        Fix Version/s 3.0.0 [ 12320356 ]
        Resolution Fixed [ 1 ]
        Hide
        Uma Maheswara Rao G added a comment -

        I have just committed this to trunk and branch-2.
        Thanks a lot, Ashish and Sravan for the patches. Also thanks to Daryn for his review!

        Show
        Uma Maheswara Rao G added a comment - I have just committed this to trunk and branch-2. Thanks a lot, Ashish and Sravan for the patches. Also thanks to Daryn for his review!
        Hide
        Daryn Sharp added a comment -

        +1 Sorry, I assumed MalformedURLException was an unchecked exception.

        Show
        Daryn Sharp added a comment - +1 Sorry, I assumed MalformedURLException was an unchecked exception.
        Hide
        Ashish Singhi added a comment -

        Thanks Daryn for taking a look on the patch.
        The URL constructor is throwing MalformedURLException and which is internally extending IOException.

        Show
        Ashish Singhi added a comment - Thanks Daryn for taking a look on the patch. The URL constructor is throwing MalformedURLException and which is internally extending IOException.
        Hide
        Daryn Sharp added a comment -

        The URL ctor doesn't throw an IOException, so is the try block needed?

        Show
        Daryn Sharp added a comment - The URL ctor doesn't throw an IOException, so is the try block needed?
        Hide
        Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12529938/HDFS-2025_5.patch
        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/2528//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/2528//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/12529938/HDFS-2025_5.patch 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/2528//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/2528//console This message is automatically generated.
        Ashish Singhi made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Ashish Singhi added a comment -

        Updated the patch addressing Uma's comment.
        Please review the patch and provide your comments.

        Show
        Ashish Singhi added a comment - Updated the patch addressing Uma's comment. Please review the patch and provide your comments.
        Ashish Singhi made changes -
        Attachment HDFS-2025_5.patch [ 12529938 ]
        Ashish Singhi made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Ashish Singhi made changes -
        Assignee sravankorumilli [ sravankorumilli ] Ashish Singhi [ ashish singhi ]
        Hide
        Uma Maheswara Rao G added a comment -

        Sravan, could you please regenreate the patch based on trunk? please generate it from root.

        Review comments on test part.
        Below lines of code almost deplicate with the assertion part of 'Go Back to File View'

        Matcher matcher = compile.matcher(viewFilePage);
        +    URL hyperlink = null;
        +    if (matcher.find()) {
        +      // got hyperlink for Tail this file
        +      hyperlink = new URL(matcher.group(1));
        +      viewFilePage = StringEscapeUtils.unescapeHtml(DFSTestUtil
        +          .urlGet(hyperlink));
        +      assertTrue("page should show preview of file contents", viewFilePage
        +          .contains(FILE_DATA));
        
        

        I would suggest, that extract it to separate methods and reuse.

        Show
        Uma Maheswara Rao G added a comment - Sravan, could you please regenreate the patch based on trunk? please generate it from root. Review comments on test part. Below lines of code almost deplicate with the assertion part of 'Go Back to File View' Matcher matcher = compile.matcher(viewFilePage); + URL hyperlink = null ; + if (matcher.find()) { + // got hyperlink for Tail this file + hyperlink = new URL(matcher.group(1)); + viewFilePage = StringEscapeUtils.unescapeHtml(DFSTestUtil + .urlGet(hyperlink)); + assertTrue( "page should show preview of file contents" , viewFilePage + .contains(FILE_DATA)); I would suggest, that extract it to separate methods and reuse.
        sravankorumilli made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        sravankorumilli made changes -
        Attachment HDFS-2025_4.patch [ 12487451 ]
        sravankorumilli made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        sravankorumilli made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        sravankorumilli added a comment -

        The Test Failures are not related to the changes so just re-submitting so that build will get triggered

        Show
        sravankorumilli added a comment - The Test Failures are not related to the changes so just re-submitting so that build will get triggered
        sravankorumilli made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        sravankorumilli made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        sravankorumilli made changes -
        Attachment HDFS-2025_3.patch [ 12487327 ]
        Hide
        sravankorumilli added a comment -

        Resumbmitting the patch as previous patch did not trigger the hudson.
        This patch includes the test code

        Show
        sravankorumilli added a comment - Resumbmitting the patch as previous patch did not trigger the hudson. This patch includes the test code
        sravankorumilli made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        sravankorumilli made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        sravankorumilli made changes -
        Attachment HDFS-2025_2.patch [ 12487252 ]
        sravankorumilli made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Hide
        sravankorumilli added a comment -

        Hi Aaron, the reason why i did not decode is, here there is no need of encoding then why to encode and once again why to decode. I will try to write a test to account this change and provide the patch with the test.

        Show
        sravankorumilli added a comment - Hi Aaron, the reason why i did not decode is, here there is no need of encoding then why to encode and once again why to decode. I will try to write a test to account this change and provide the patch with the test.
        Hide
        Aaron T. Myers added a comment -

        Hi Sravan, any reason you couldn't just use URLDecoder.decode(...) instead of creating an extraneous URL object? Also, could you please write a test case to account for this, perhaps in TestDatanodeJsp.java ?

        Show
        Aaron T. Myers added a comment - Hi Sravan, any reason you couldn't just use URLDecoder.decode(...) instead of creating an extraneous URL object? Also, could you please write a test case to account for this, perhaps in TestDatanodeJsp.java ?
        Hide
        sravankorumilli added a comment -

        In the tail.jsp we are using the charset=UTF-8 then the output of out.print will be automatically encoded to UTF-8.

        For Reference :- http://www.w3.org/International/O-HTTP-charset

        Show
        sravankorumilli added a comment - In the tail.jsp we are using the charset=UTF-8 then the output of out.print will be automatically encoded to UTF-8. For Reference :- http://www.w3.org/International/O-HTTP-charset
        Hide
        sravankorumilli added a comment -

        Thanks Daryn for your comments, as I observe form's fields will be encoded and sent through the HTTP request implicitly then there is no need to encode once again. Encoding the referrer once again is failing further URL validations which will be called when we click submit as in the corresponding code snippet

        referrer = JspHelper.validateURL(req.getParameter("referrer"));
        

        req.getParameter("referrer") will give the encoded URL value and inside validateURL URL constructor will throw an Exception as the value passed to it is not a URL.

        Correct me if I am wrong...

        Show
        sravankorumilli added a comment - Thanks Daryn for your comments, as I observe form's fields will be encoded and sent through the HTTP request implicitly then there is no need to encode once again. Encoding the referrer once again is failing further URL validations which will be called when we click submit as in the corresponding code snippet referrer = JspHelper.validateURL(req.getParameter( "referrer" )); req.getParameter("referrer") will give the encoded URL value and inside validateURL URL constructor will throw an Exception as the value passed to it is not a URL. Correct me if I am wrong...
        Hide
        Daryn Sharp added a comment -

        The validateURL call that was removed is intended to properly encode the referrer for embedding with the hidden field. You need to account for both the raw display of the referrer and the encoded value within the form's hidden field.

        Show
        Daryn Sharp added a comment - The validateURL call that was removed is intended to properly encode the referrer for embedding with the hidden field. You need to account for both the raw display of the referrer and the encoded value within the form's hidden field.
        Hide
        sravankorumilli added a comment -

        Both the Test Failures are not related.
        For this change I don't think we require a test case.
        I verified manually after applying the patch there were no problems in the UI.

        Show
        sravankorumilli added a comment - Both the Test Failures are not related. For this change I don't think we require a test case. I verified manually after applying the patch there were no problems in the UI.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12481710/HDFS-2025_1.patch
        against trunk revision 1132881.

        +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 javadoc. The javadoc tool did not generate any warning messages.

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

        +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 core unit tests:
        org.apache.hadoop.cli.TestHDFSCLI
        org.apache.hadoop.hdfs.TestHFlush

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

        +1 system test framework. The patch passed system test framework compile.

        Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/734//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HDFS-Build/734//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/734//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/12481710/HDFS-2025_1.patch against trunk revision 1132881. +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 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +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 core unit tests: org.apache.hadoop.cli.TestHDFSCLI org.apache.hadoop.hdfs.TestHFlush +1 contrib tests. The patch passed contrib unit tests. +1 system test framework. The patch passed system test framework compile. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/734//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-HDFS-Build/734//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/734//console This message is automatically generated.
        sravankorumilli made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        sravankorumilli made changes -
        Attachment HDFS-2025_1.patch [ 12481710 ]
        Hide
        sravankorumilli added a comment -

        Updated the patch after addressing the test case failure.

        Show
        sravankorumilli added a comment - Updated the patch after addressing the test case failure.
        Todd Lipcon made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Hide
        Todd Lipcon added a comment -

        canceling patch due to failed test

        Show
        Todd Lipcon added a comment - canceling patch due to failed test
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12481569/HDFS-2025.patch
        against trunk revision 1132525.

        +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 javadoc. The javadoc tool did not generate any warning messages.

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

        +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 core unit tests:
        org.apache.hadoop.hdfs.server.datanode.TestDatanodeJsp

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

        +1 system test framework. The patch passed system test framework compile.

        Test results: https://builds.apache.org/hudson/job/PreCommit-HDFS-Build/714//testReport/
        Findbugs warnings: https://builds.apache.org/hudson/job/PreCommit-HDFS-Build/714//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Console output: https://builds.apache.org/hudson/job/PreCommit-HDFS-Build/714//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/12481569/HDFS-2025.patch against trunk revision 1132525. +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 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +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 core unit tests: org.apache.hadoop.hdfs.server.datanode.TestDatanodeJsp +1 contrib tests. The patch passed contrib unit tests. +1 system test framework. The patch passed system test framework compile. Test results: https://builds.apache.org/hudson/job/PreCommit-HDFS-Build/714//testReport/ Findbugs warnings: https://builds.apache.org/hudson/job/PreCommit-HDFS-Build/714//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Console output: https://builds.apache.org/hudson/job/PreCommit-HDFS-Build/714//console This message is automatically generated.
        sravankorumilli made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Affects Version/s 0.20.1 [ 12314048 ]
        sravankorumilli made changes -
        Attachment HDFS-2025.patch [ 12481569 ]
        Hide
        sravankorumilli added a comment -

        In DatanodeJspHelper.generateFileChunksForTail

        DatanodeJspHelper.java
        static void generateFileChunksForTail(JspWriter out, HttpServletRequest req,
        Configuration conf) throws IOException,InterruptedException {
        
        final String referrer = JspHelper.validateURL(req.getParameter("referrer"));
        //this will encode the referrer url in UTF-8
        //some more code 
        //the encoded url is itself being used in hyperlink
        out.print("<a href=\"" + referrer + "\">Go Back to File View</a><hr>");
        }
        

        Here JspHelper.validateURL(req.getParameter("referrer")) will encode the referrer in UTF-8 and the same will be used as hyperlink which is treated as a relative url. I have attached the snapshot of the error

        The solution can be simple not to encode.

        Show
        sravankorumilli added a comment - In DatanodeJspHelper.generateFileChunksForTail DatanodeJspHelper.java static void generateFileChunksForTail(JspWriter out, HttpServletRequest req, Configuration conf) throws IOException,InterruptedException { final String referrer = JspHelper.validateURL(req.getParameter( "referrer" )); // this will encode the referrer url in UTF-8 //some more code //the encoded url is itself being used in hyperlink out.print( "<a href=\" " + referrer + " \ ">Go Back to File View</a><hr>" ); } Here JspHelper.validateURL(req.getParameter("referrer")) will encode the referrer in UTF-8 and the same will be used as hyperlink which is treated as a relative url. I have attached the snapshot of the error The solution can be simple not to encode.
        sravankorumilli made changes -
        Field Original Value New Value
        Attachment ScreenShot_1.jpg [ 12481215 ]
        Hide
        sravankorumilli added a comment -

        When Go Back to File View hyperlink is clicked this is the result. If we see the address bar we can say that the http url is encoded and treated as a relative url.

        Show
        sravankorumilli added a comment - When Go Back to File View hyperlink is clicked this is the result. If we see the address bar we can say that the http url is encoded and treated as a relative url.
        sravankorumilli created issue -

          People

          • Assignee:
            Ashish Singhi
            Reporter:
            sravankorumilli
          • Votes:
            0 Vote for this issue
            Watchers:
            13 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development