• Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • core

      What is wrong?

      BlueOcean button points to host with different port from the one specified in
      ```
      /etc/default/jenkins
      ...
      HTTP_PORT=9001
      ...
      ```
      See attached image.

      How should it be?

      BlueOcean button should point to the same host:port, which Jenkins is using.

      Reproduce

      Install jenkins
      Install BlueOcean plugin.
      Restart jenkins.
      Due to default parameters, everything works fine.
      Open /var/default/jenkins and change HTTP_PORT=8080 to HTTP_PORT=9000
      Restart jenkins.
      Everything still works fine.
      Open /var/default/jenkins and change HTTP_PORT=9000 to HTTP_PORT=9001
      Restart jenkins.
      BlueOcean button does not change its location

      Cause

      Blue ocean uses the Jenkins URL setting extensively for guessing the URL to the server. Many other things, such as email links, also do this. It should be reasonable to expect that Jenkins URL could be set by the environment.

          [JENKINS-40314] Jenkins URL cannot be set via environment

          James Dumay added a comment - - edited

          gram7gram when you changed the port in /var/default/jenkins did it change the URL in Manage Jenkins ->
          Jenkins Location -> Jenkins URL? I believe this is where we get the full URL.

          James Dumay added a comment - - edited gram7gram when you changed the port in /var/default/jenkins did it change the URL in Manage Jenkins -> Jenkins Location -> Jenkins URL? I believe this is where we get the full URL.

          Gram Gram added a comment -

          jdumay as you pointed out,
          Manage Jenkins -> Jenkins Location -> Jenkins URL
          does not change, when HTTP_PORT was changed in /var/default/jenkins.

          I see I should manually change Jenkins URL when HTTP_PORT is changed

          Gram Gram added a comment - jdumay as you pointed out, Manage Jenkins -> Jenkins Location -> Jenkins URL does not change, when HTTP_PORT was changed in /var/default/jenkins. I see I should manually change Jenkins URL when HTTP_PORT is changed

          James Dumay added a comment -

          gram7gram I think this should be converted into a core Jenkins issue. Would be reasonable to expect that the Jenkins URL could be set via the environment.

          James Dumay added a comment - gram7gram I think this should be converted into a core Jenkins issue. Would be reasonable to expect that the Jenkins URL could be set via the environment.

          Daniel Beck added a comment -

          Not a bug. The intended actual host and port will often be unknown to Jenkins due to reverse proxies etc.

          While handling a request, Jenkins can infer the root URL, but in general, it's just impossible. Changing the configured(!!) URL based on a preference that may well have no effect on the effective URL accessed by users seems like a very bad idea.

          Daniel Beck added a comment - Not a bug. The intended actual host and port will often be unknown to Jenkins due to reverse proxies etc. While handling a request, Jenkins can infer the root URL, but in general, it's just impossible. Changing the configured(!!) URL based on a preference that may well have no effect on the effective URL accessed by users seems like a very bad idea.

            Unassigned Unassigned
            gram7gram Gram Gram
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: