• Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • core

      Jenkins URL field is showing a value even not being set (it is actually unset in config.xml). This behaviour is confusing for users (it seems to be set, but it's not).

      One things to improve it:

      1. Don't set the value in the field, but suggest it (form validation)
      2. Add an administrative monitor pointing to it

          [JENKINS-31661] Jenkins.rootUrl too often unset or incorrect

          Paul Milliken added a comment -

          Since this has been merged in 2.119, my Jenkins installation is constantly showing the "Jenkins root URL seems to be invalid. It is required for the proper operation of many Jenkins features like email notifications, PR status update, and environment variables such as BUILD_URL." notification.

          I have tried modified the URL setting to a completely different value, and then back to the correct value to ensure that it is definitely set, yet this message continues to display (even after a Jenkins restart).

          The configured URL is definitely correct. I'm guessing there's some extra check being performed which makes Jenkins believe it to be incorrect - most likely something related to the docker / nginx setup I've got going on. However, I feel like there should be a simple way of confirming to Jenkins that yes, the URL as configured is the correct one for it to be using and to stop prompting about it.

          Paul Milliken added a comment - Since this has been merged in 2.119, my Jenkins installation is constantly showing the "Jenkins root URL seems to be invalid. It is required for the proper operation of many Jenkins features like email notifications, PR status update, and environment variables such as  BUILD_URL ." notification. I have tried modified the URL setting to a completely different value, and then back to the correct value to ensure that it is definitely set, yet this message continues to display (even after a Jenkins restart). The configured URL is definitely correct. I'm guessing there's some extra check being performed which makes Jenkins believe it to be incorrect - most likely something related to the docker / nginx setup I've got going on. However, I feel like there should be a simple way of confirming to Jenkins that yes, the URL as configured is the correct one for it to be using and to stop prompting about it.

          Wadeck Follonier added a comment - - edited

          pmilliken Thank you for your comment.

          You can see some examples of expected behavior in test.

          If you can provide the URL you are using (if it's not confidential, etc.) we can perhaps detect if it's a bug in our URL validation. We use the standard validator and even add the "_" in the authorized list of characters. Perhaps you are just using a character that works but is not standard in your URL.

          If you want to hide the warning, you can dismiss them in the configuration. For that reason there is not need (at least until now) to provide a way to validate a data that seems incorrect for the admin monitor.
          To disable an administrative monitor,

          1. you need to go (as admin) in "Manage Jenkins"
          2. "Configure System"
          3. inside "Administratrive monitors configuration" section
          4. click on [Administrative monitors...] on the right
          5. uncheck the one you want to disable
          6. finally save (or apply).

          Wadeck Follonier added a comment - - edited pmilliken Thank you for your comment. You can see some examples of expected behavior in test . If you can provide the URL you are using (if it's not confidential, etc.) we can perhaps detect if it's a bug in our URL validation. We use the standard validator and even add the "_" in the authorized list of characters. Perhaps you are just using a character that works but is not standard in your URL. If you want to hide the warning, you can dismiss them in the configuration. For that reason there is not need (at least until now) to provide a way to validate a data that seems incorrect for the admin monitor. To disable an administrative monitor, you need to go (as admin) in "Manage Jenkins" "Configure System" inside "Administratrive monitors configuration" section click on [Administrative monitors...] on the right uncheck the one you want to disable finally save (or apply).

          Omar Kohl added a comment - - edited

          Same issue here. It is constantly showing that message. The only unusual thing I can think of is that the domain is not public but it is configured in an internal DNS Server that is properly included in /etc/resolv.conf on the Jenkins server. From the command-line of said server it is no problem to resolve the domain.

          The URL is: https://jenkins.XXX.intern/ where XXX is just ASCII letters. No special characters.

          I tried removing the trailing slash (since you have no testcase with a trailing slash) but it keeps getting added again and therefore makes no difference.

          Omar Kohl added a comment - - edited Same issue here. It is constantly showing that message. The only unusual  thing I can think of is that the domain is not public but it is configured in an internal DNS Server that is properly included in /etc/resolv.conf on the Jenkins server. From the command-line of said server it is no problem to resolve the domain. The URL is: https://jenkins.XXX.intern/  where XXX is just ASCII letters. No special characters. I tried removing the trailing slash (since you have no testcase with a trailing slash) but it keeps getting added again and therefore makes no difference.

          Wadeck Follonier added a comment - - edited

          ok2332 in your case the problem is the .intern that is not standard and so is not considered as valid by the apache library we use to validate the URL.

          The trailing slash is not a problem. FYI it is added if not present in the form.

          So for the moment, I think the best is just to follow the above workaround steps to disable the monitor.

          Wadeck Follonier added a comment - - edited ok2332 in your case the problem is the .intern that is not standard and so is not considered as valid by the apache library we use to validate the URL. The trailing slash is not a problem. FYI it is added if not present in the form. So for the moment, I think the best is just to follow the above workaround steps to disable the monitor.

          Omar Kohl added a comment -

          OK I switched the corresponding administrative monitor off.

          You may want to consider being less strict. Why should it be a problem to use internal domains even though they are invalid TLDs? Just a thought...

          Omar Kohl added a comment - OK I switched the corresponding administrative monitor off. You may want to consider being less strict. Why should it be a problem to use internal domains even though they are invalid TLDs? Just a thought...

          ok2332 you're totally right, it was not the expected behavior concerning the TLD, I explicitely added the "_" case for internal hostname but not thought about the custom TLDs.

          Wadeck Follonier added a comment - ok2332 you're totally right, it was not the expected behavior concerning the TLD, I explicitely added the "_" case for internal hostname but not thought about the custom TLDs.

          Wadeck Follonier added a comment - - edited

          pmilliken ok2332 FYI I created a PR#3415 to address your concern. Feel free to test / review it.

          Also filed a separate issue : JENKINS-51064

          And a PR#3416 for adding the direct "Dismiss" button in this monitor message.

          Wadeck Follonier added a comment - - edited pmilliken ok2332 FYI I created a PR#3415 to address your concern. Feel free to test / review it. Also filed a separate issue : JENKINS-51064 And a PR#3416 for adding the direct "Dismiss" button in this monitor message.

          Daniel Beck added a comment -

          wfollonier I wonder whether you could just consider rootUrlFromRequest for the admin monitor – if that's the same as is configured, it can't be too wrong. WDYT?

          Daniel Beck added a comment - wfollonier I wonder whether you could just consider rootUrlFromRequest for the admin monitor – if that's the same as is configured, it can't be too wrong. WDYT?

          Paul Milliken added a comment - - edited

          wfollonier That sounds promising. I'm not set up to be able to test it readily at the moment unfortunately. My Jenkins URL is http://jenkins.XXXX.private/ - hopefully the relaxation of the TLD validation will permit that (from a quick read of the code, I think it will). For the time being, I've disabled the admin monitor on my installation.

          Thanks for the quick response.

          Paul Milliken added a comment - - edited wfollonier That sounds promising. I'm not set up to be able to test it readily at the moment unfortunately. My Jenkins URL is http://jenkins.XXXX.private/  - hopefully the relaxation of the TLD validation will permit that (from a quick read of the code, I think it will). For the time being, I've disabled the admin monitor on my installation. Thanks for the quick response.

          Oleg Nenashev added a comment -

          Hit it on my instance as well. Will link the ticket to JENKINS-51064 properly

          Oleg Nenashev added a comment - Hit it on my instance as well. Will link the ticket to JENKINS-51064 properly

            wfollonier Wadeck Follonier
            amuniz Antonio Muñiz
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: