Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-65905

ReverseProxySetupMonitor has broken referer de-/encoding

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: core
    • Labels:
      None
    • Environment:
      Jenkins 2.289.1 in running docker
      behind nginx reverse proxy
    • Similar Issues:

      Description

      The ReverseProxySetupMonitor seems to be broken.

      I get the following log output if I use one of the following

      • BASE=administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor
        curl -iL -e http://your.reverse.proxy/jenkins/manage \
                    http://your.reverse.proxy/jenkins/${BASE}/test
        
      • the reverse proxy monitor internally uses an Redirect to
        http://your.reverse.proxy/jenkins/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/http%3A%2F%2Fyour.reverse.proxy%2Fjenkins%2Fmanage/
        

        If I use this URL directly with curl I get the same error.

       WARNING	h.d.ReverseProxySetupMonitor#getTestForReverseProxySetup: http://your.reverse.proxy/jenkins/manage vs. http:
      

      If I manipulate the url at the end of the URL the log message changes.

      I assume an issue in the process of decoding the parameter of ReverseProxySetupMonitor#getTestForReverseProxySetup.

      Maybe this is a regression in stapler.

       

        Attachments

          Activity

          daussalar Lars Sadau created issue -
          daussalar Lars Sadau made changes -
          Field Original Value New Value
          Priority Minor [ 4 ] Trivial [ 5 ]
          daussalar Lars Sadau made changes -
          Priority Trivial [ 5 ] Minor [ 4 ]
          daussalar Lars Sadau made changes -
          Environment Jenkins 2.289.1 in running docker
          behind nginx reverse proxy
          Hide
          jasperyue Tongshu added a comment - - edited

          I also encountered this problem. I have a jenkins docker images based on 2.249.3, it works fine in my Macbook Pro but broken in my Redhat linux.

          Macbook Pro :

          Jenkins: 2.249.3

          OS: Linux - 5.10.25-linuxkit

           

          Redhat Linux:

          Jenkins: 2.249.3
          OS: Linux - 3.10.0-1062.el7.x86_64

           

          After some reasearch and follow the steps in JENKINS-30834

          Macbook Pro:

          curl -iL -e http://jks.local/manage http://jks.local/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/test
          

          I get the log output as follow:

          HTTP/1.1 302 Found
          Content-Length: 0
          Date: Tue, 29 Jun 2021 04:58:13 GMT
          Location: http://jks.local/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/http%3A%2F%2Fjks.local%2Fmanage/
          Server: Jetty(9.4.30.v20200611)
          Stapler-Trace-001: -> evaluate(<hudson.model.Hudson@6ec35bae> :hudson.model.Hudson,"/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/test")
          Stapler-Trace-002: -> evaluate(((StaplerProxy)<hudson.model.Hudson@6ec35bae>).getTarget(),"/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/test")
          Stapler-Trace-003: -> evaluate(<hudson.model.Hudson@6ec35bae>.getAdministrativeMonitor("hudson.diagnosis.ReverseProxySetupMonitor"),"/test")
          Stapler-Trace-004: -> evaluate(<hudson.diagnosis.ReverseProxySetupMonitor@1fbbd72a> :hudson.diagnosis.ReverseProxySetupMonitor,"/test")
          Stapler-Trace-005: -> evaluate(((StaplerProxy)<hudson.diagnosis.ReverseProxySetupMonitor@1fbbd72a>).getTarget(),"/test")
          Stapler-Trace-006: -> <hudson.diagnosis.ReverseProxySetupMonitor@1fbbd72a>.doTest(...)
          X-Content-Type-Options: nosniff
          
          HTTP/1.1 200 OK
          Content-Length: 0
          Date: Tue, 29 Jun 2021 04:58:13 GMT
          Server: Jetty(9.4.30.v20200611)
          Stapler-Trace-001: -> evaluate(<hudson.model.Hudson@6ec35bae> :hudson.model.Hudson,"/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/http%3A%2F%2Fjks.local%2Fmanage")
          Stapler-Trace-002: -> evaluate(((StaplerProxy)<hudson.model.Hudson@6ec35bae>).getTarget(),"/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/http%3A%2F%2Fjks.local%2Fmanage")
          Stapler-Trace-003: -> evaluate(<hudson.model.Hudson@6ec35bae>.getAdministrativeMonitor("hudson.diagnosis.ReverseProxySetupMonitor"),"/testForReverseProxySetup/http%3A%2F%2Fjks.local%2Fmanage")
          Stapler-Trace-004: -> evaluate(<hudson.diagnosis.ReverseProxySetupMonitor@1fbbd72a> :hudson.diagnosis.ReverseProxySetupMonitor,"/testForReverseProxySetup/http%3A%2F%2Fjks.local%2Fmanage")
          Stapler-Trace-005: -> evaluate(((StaplerProxy)<hudson.diagnosis.ReverseProxySetupMonitor@1fbbd72a>).getTarget(),"/testForReverseProxySetup/http%3A%2F%2Fjks.local%2Fmanage")
          Stapler-Trace-006: -> evaluate(<hudson.diagnosis.ReverseProxySetupMonitor@1fbbd72a>.getTestForReverseProxySetup("http://jks.local/manage"),"")
          X-Content-Type-Options: nosniff
          

          Redhat Linux:

          curl -iL -e http://jks.local/manage http://jks.local/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/test
          

          I get the log output as follow:

          HTTP/1.1 302 Found
          Server: nginx/1.17.3
          Date: Tue, 29 Jun 2021 05:00:10 GMT
          Content-Length: 0
          Connection: keep-alive
          Location: http://jks.devops/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/http%3A%2F%2Fjks.devops%2Fmanage/
          Stapler-Trace-001: -> evaluate(<hudson.model.Hudson@46170fb7> :hudson.model.Hudson,"/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/test")
          Stapler-Trace-002: -> evaluate(((StaplerProxy)<hudson.model.Hudson@46170fb7>).getTarget(),"/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/test")
          Stapler-Trace-003: -> evaluate(<hudson.model.Hudson@46170fb7>.getAdministrativeMonitor("hudson.diagnosis.ReverseProxySetupMonitor"),"/test")
          Stapler-Trace-004: -> evaluate(<hudson.diagnosis.ReverseProxySetupMonitor@4bf69a13> :hudson.diagnosis.ReverseProxySetupMonitor,"/test")
          Stapler-Trace-005: -> evaluate(((StaplerProxy)<hudson.diagnosis.ReverseProxySetupMonitor@4bf69a13>).getTarget(),"/test")
          Stapler-Trace-006: -> <hudson.diagnosis.ReverseProxySetupMonitor@4bf69a13>.doTest(...)
          X-Content-Type-Options: nosniff
          
          HTTP/1.1 404 Not Found
          Server: nginx/1.17.3
          Date: Tue, 29 Jun 2021 05:00:10 GMT
          Content-Type: text/html;charset=iso-8859-1
          Content-Length: 631
          Connection: keep-alive
          Cache-Control: must-revalidate,no-cache,no-store
          Stapler-Trace-001: -> evaluate(<hudson.model.Hudson@46170fb7> :hudson.model.Hudson,"/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/http:/jks.devops/manage")
          Stapler-Trace-002: -> evaluate(((StaplerProxy)<hudson.model.Hudson@46170fb7>).getTarget(),"/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/http:/jks.devops/manage")
          Stapler-Trace-003: -> evaluate(<hudson.model.Hudson@46170fb7>.getAdministrativeMonitor("hudson.diagnosis.ReverseProxySetupMonitor"),"/testForReverseProxySetup/http:/jks.devops/manage")
          Stapler-Trace-004: -> evaluate(<hudson.diagnosis.ReverseProxySetupMonitor@4bf69a13> :hudson.diagnosis.ReverseProxySetupMonitor,"/testForReverseProxySetup/http:/jks.devops/manage")
          Stapler-Trace-005: -> evaluate(((StaplerProxy)<hudson.diagnosis.ReverseProxySetupMonitor@4bf69a13>).getTarget(),"/testForReverseProxySetup/http:/jks.devops/manage")
          Stapler-Trace-006: -> evaluate(<hudson.diagnosis.ReverseProxySetupMonitor@4bf69a13>.getTestForReverseProxySetup("http:"),"/jks.devops/manage")
          X-Content-Type-Options: nosniff
          
          <html>
          <head>
          <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
          <title>Error 404 http://jks.devops/manage vs. http:</title>
          </head>
          <body><h2>HTTP ERROR 404 http://jks.devops/manage vs. http:</h2>
          <table>
          <tr><th>URI:</th><td>/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/http:/jks.devops/manage/</td></tr>
          <tr><th>STATUS:</th><td>404</td></tr>
          <tr><th>MESSAGE:</th><td>http://jks.devops/manage vs. http:</td></tr>
          <tr><th>SERVLET:</th><td>Stapler</td></tr>
          </table>
          <hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.30.v20200611</a><hr/>
          
          </body>
          </html>
          

          That problem occurs when redirect happens, I have no idea why, any help is appreciated

          Show
          jasperyue Tongshu added a comment - - edited I also encountered this problem. I have a jenkins docker images based on 2.249.3, it works fine in my Macbook Pro but broken in my Redhat linux. Macbook Pro : Jenkins: 2.249.3 OS: Linux - 5.10.25-linuxkit   Redhat Linux: Jenkins: 2.249.3 OS: Linux - 3.10.0-1062.el7.x86_64   After some reasearch and follow the steps in  JENKINS-30834 ,  Macbook Pro: curl -iL -e http://jks. local /manage http://jks. local /administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/test I get the log output as follow: HTTP/1.1 302 Found Content-Length: 0 Date: Tue, 29 Jun 2021 04:58:13 GMT Location: http://jks.local/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/http%3A%2F%2Fjks.local%2Fmanage/ Server: Jetty(9.4.30.v20200611) Stapler-Trace-001: -> evaluate(<hudson.model.Hudson@6ec35bae> :hudson.model.Hudson,"/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/test") Stapler-Trace-002: -> evaluate(((StaplerProxy)<hudson.model.Hudson@6ec35bae>).getTarget(),"/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/test") Stapler-Trace-003: -> evaluate(<hudson.model.Hudson@6ec35bae>.getAdministrativeMonitor("hudson.diagnosis.ReverseProxySetupMonitor"),"/test") Stapler-Trace-004: -> evaluate(<hudson.diagnosis.ReverseProxySetupMonitor@1fbbd72a> :hudson.diagnosis.ReverseProxySetupMonitor,"/test") Stapler-Trace-005: -> evaluate(((StaplerProxy)<hudson.diagnosis.ReverseProxySetupMonitor@1fbbd72a>).getTarget(),"/test") Stapler-Trace-006: -> <hudson.diagnosis.ReverseProxySetupMonitor@1fbbd72a>.doTest(...) X-Content-Type-Options: nosniff HTTP/1.1 200 OK Content-Length: 0 Date: Tue, 29 Jun 2021 04:58:13 GMT Server: Jetty(9.4.30.v20200611) Stapler-Trace-001: -> evaluate(<hudson.model.Hudson@6ec35bae> :hudson.model.Hudson,"/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/http%3A%2F%2Fjks.local%2Fmanage") Stapler-Trace-002: -> evaluate(((StaplerProxy)<hudson.model.Hudson@6ec35bae>).getTarget(),"/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/http%3A%2F%2Fjks.local%2Fmanage") Stapler-Trace-003: -> evaluate(<hudson.model.Hudson@6ec35bae>.getAdministrativeMonitor("hudson.diagnosis.ReverseProxySetupMonitor"),"/testForReverseProxySetup/http%3A%2F%2Fjks.local%2Fmanage") Stapler-Trace-004: -> evaluate(<hudson.diagnosis.ReverseProxySetupMonitor@1fbbd72a> :hudson.diagnosis.ReverseProxySetupMonitor,"/testForReverseProxySetup/http%3A%2F%2Fjks.local%2Fmanage") Stapler-Trace-005: -> evaluate(((StaplerProxy)<hudson.diagnosis.ReverseProxySetupMonitor@1fbbd72a>).getTarget(),"/testForReverseProxySetup/http%3A%2F%2Fjks.local%2Fmanage") Stapler-Trace-006: -> evaluate(<hudson.diagnosis.ReverseProxySetupMonitor@1fbbd72a>.getTestForReverseProxySetup("http://jks.local/manage"),"") X-Content-Type-Options: nosniff Redhat Linux: curl -iL -e http://jks. local /manage http://jks. local /administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/test I get the log output as follow: HTTP/1.1 302 Found Server: nginx/1.17.3 Date: Tue, 29 Jun 2021 05:00:10 GMT Content-Length: 0 Connection: keep-alive Location: http://jks.devops/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/http%3A%2F%2Fjks.devops%2Fmanage/ Stapler-Trace-001: -> evaluate(<hudson.model.Hudson@46170fb7> :hudson.model.Hudson,"/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/test") Stapler-Trace-002: -> evaluate(((StaplerProxy)<hudson.model.Hudson@46170fb7>).getTarget(),"/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/test") Stapler-Trace-003: -> evaluate(<hudson.model.Hudson@46170fb7>.getAdministrativeMonitor("hudson.diagnosis.ReverseProxySetupMonitor"),"/test") Stapler-Trace-004: -> evaluate(<hudson.diagnosis.ReverseProxySetupMonitor@4bf69a13> :hudson.diagnosis.ReverseProxySetupMonitor,"/test") Stapler-Trace-005: -> evaluate(((StaplerProxy)<hudson.diagnosis.ReverseProxySetupMonitor@4bf69a13>).getTarget(),"/test") Stapler-Trace-006: -> <hudson.diagnosis.ReverseProxySetupMonitor@4bf69a13>.doTest(...) X-Content-Type-Options: nosniff HTTP/1.1 404 Not Found Server: nginx/1.17.3 Date: Tue, 29 Jun 2021 05:00:10 GMT Content-Type: text/html;charset=iso-8859-1 Content-Length: 631 Connection: keep-alive Cache-Control: must-revalidate,no-cache,no-store Stapler-Trace-001: -> evaluate(<hudson.model.Hudson@46170fb7> :hudson.model.Hudson,"/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/http:/jks.devops/manage") Stapler-Trace-002: -> evaluate(((StaplerProxy)<hudson.model.Hudson@46170fb7>).getTarget(),"/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/http:/jks.devops/manage") Stapler-Trace-003: -> evaluate(<hudson.model.Hudson@46170fb7>.getAdministrativeMonitor("hudson.diagnosis.ReverseProxySetupMonitor"),"/testForReverseProxySetup/http:/jks.devops/manage") Stapler-Trace-004: -> evaluate(<hudson.diagnosis.ReverseProxySetupMonitor@4bf69a13> :hudson.diagnosis.ReverseProxySetupMonitor,"/testForReverseProxySetup/http:/jks.devops/manage") Stapler-Trace-005: -> evaluate(((StaplerProxy)<hudson.diagnosis.ReverseProxySetupMonitor@4bf69a13>).getTarget(),"/testForReverseProxySetup/http:/jks.devops/manage") Stapler-Trace-006: -> evaluate(<hudson.diagnosis.ReverseProxySetupMonitor@4bf69a13>.getTestForReverseProxySetup("http:"),"/jks.devops/manage") X-Content-Type-Options: nosniff <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <title>Error 404 http://jks.devops/manage vs. http:</title> </head> <body><h2>HTTP ERROR 404 http://jks.devops/manage vs. http:</h2> <table> <tr><th>URI:</th><td>/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/http:/jks.devops/manage/</td></tr> <tr><th>STATUS:</th><td>404</td></tr> <tr><th>MESSAGE:</th><td>http://jks.devops/manage vs. http:</td></tr> <tr><th>SERVLET:</th><td>Stapler</td></tr> </table> <hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.30.v20200611</a><hr/> </body> </html> That problem occurs when redirect happens, I have no idea why, any help is appreciated

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            daussalar Lars Sadau
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: