Uploaded image for project: 'Infrastructure'
  1. Infrastructure
  2. INFRA-2735

trusted.ci web server configuration broken

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: trusted.ci
    • Labels:
      None
    • Similar Issues:

      Description

      Trusted CI no longer sends useful redirects as it believes the server name to be [trusted.ci.jenkins.io:1443].

      Location headers therefore look like this:

      location: https://[trusted.ci.jenkins.io:1443]:1443/job/update_center/329473/

      This might be related to the Jetty update in 2.235.4, unsure.

      The following diagnostic script:

      println Jenkins.instance.rootUrlFromRequest
      println org.kohsuke.stapler.Stapler.currentRequest.getHeader('X-Forwarded-For')
      println org.kohsuke.stapler.Stapler.currentRequest.getHeader('X-Forwarded-Host')
      println org.kohsuke.stapler.Stapler.currentRequest.getHeader('X-Forwarded-Proto')
      println org.kohsuke.stapler.Stapler.currentRequest.getHeader('X-Forwarded-Port')
      println org.kohsuke.stapler.Stapler.currentRequest.serverPort
      println org.kohsuke.stapler.Stapler.currentRequest.serverName 

      produces this output:

      https://trusted.ci.jenkins.io:1443/
      (redacted IP address)
      trusted.ci.jenkins.io:1443
      https
      1443
      1443
      [trusted.ci.jenkins.io:1443] 

      https://docs.oracle.com/javaee/5/api/javax/servlet/ServletRequest.html#getServerName() is defined to NOT include the port.

        Attachments

          Activity

          Show
          timja Tim Jacomb added a comment - Looks like 2 related PRs have been merged and unreleased in Jetty: https://github.com/eclipse/jetty.project/pull/5226 https://github.com/eclipse/jetty.project/pull/5251 also see: https://github.com/eclipse/jetty.project/issues/5224
          Hide
          danielbeck Daniel Beck added a comment -

          I added the following to /etc/apache2/sites-enabled/25-trusted.ci.jenkins.io.conf:

          # 2020-09-24 DB
          RequestHeader set X-Forwarded-Host "trusted.ci.jenkins.io" 

          Now the header has two values, but it looks like Jetty handles that and now

           https://trusted.ci.jenkins.io:1443/
          172.31.29.27
          trusted.ci.jenkins.io, trusted.ci.jenkins.io:1443
          https
          1443
          1443
          trusted.ci.jenkins.io

          This should probably be added to https://github.com/jenkins-infra/jenkins-infra/blob/6418e97802ab86ebd1b1b3bbd04568e3b9ca1934/dist/profile/manifests/buildmaster.pp#L388 but I'd prefer if we investigated where the wrong value is even coming from, because I cannot find it.

          Show
          danielbeck Daniel Beck added a comment - I added the following to /etc/apache2/sites-enabled/25-trusted.ci.jenkins.io.conf : # 2020-09-24 DB RequestHeader set X-Forwarded-Host "trusted.ci.jenkins.io" Now the header has two values, but it looks like Jetty handles that and now https://trusted.ci.jenkins.io:1443/ 172.31.29.27 trusted.ci.jenkins.io, trusted.ci.jenkins.io:1443 https 1443 1443 trusted.ci.jenkins.io This should probably be added to https://github.com/jenkins-infra/jenkins-infra/blob/6418e97802ab86ebd1b1b3bbd04568e3b9ca1934/dist/profile/manifests/buildmaster.pp#L388 but I'd prefer if we investigated where the wrong value is even coming from, because I cannot find it.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            danielbeck Daniel Beck
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: