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

Jenkins.rootUrl too often unset or incorrect

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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

        Attachments

          Issue Links

            Activity

            amuniz Antonio Muñiz created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Labels ux
            Hide
            jglick Jesse Glick added a comment -

            Cf. JenkinsLocationConfiguration. I also recommend caching the last-inferred URL on every page load (Functions.initPageVariables) so that Jenkins.getRootUrl would normally be non-null even outside a request even if the admin has not set it. Otherwise change #1 will cause even fewer installations to have a root URL set.

            Show
            jglick Jesse Glick added a comment - Cf. JenkinsLocationConfiguration . I also recommend caching the last-inferred URL on every page load ( Functions.initPageVariables ) so that Jenkins.getRootUrl would normally be non-null even outside a request even if the admin has not set it. Otherwise change #1 will cause even fewer installations to have a root URL set.
            jglick Jesse Glick made changes -
            Summary Jenkins URL field showing a value that is not really set Jenkins.rootUrl too often unset or incorrect
            Show
            amuniz Antonio Muñiz added a comment - https://github.com/jenkinsci/jenkins/pull/1921
            recena Manuel Recena Soto made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Status In Progress [ 3 ] Open [ 1 ]
            Hide
            jglick Jesse Glick added a comment -

            As of 2.0 I think we agreed that this should be set by the setup wizard, which should be both simpler than previously proposed approaches, and safer. I would recommend explicitly showing the guessed URL in an editable text field so that the user can correct this in the case of a reverse proxy. We can also get rid of the warning about use of localhost: if that is what you have picked, so be it.

            Show
            jglick Jesse Glick added a comment - As of 2.0 I think we agreed that this should be set by the setup wizard, which should be both simpler than previously proposed approaches, and safer. I would recommend explicitly showing the guessed URL in an editable text field so that the user can correct this in the case of a reverse proxy. We can also get rid of the warning about use of localhost : if that is what you have picked, so be it.
            Hide
            recena Manuel Recena Soto added a comment -
            Show
            recena Manuel Recena Soto added a comment - Jesse Glick
            Hide
            amuniz Antonio Muñiz added a comment -

            Yeah, agreed.

            Show
            amuniz Antonio Muñiz added a comment - Yeah, agreed.
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-32192 [ JENKINS-32192 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 167098 ] JNJira + In-Review [ 182583 ]
            jglick Jesse Glick made changes -
            Link This issue is blocking JENKINS-33508 [ JENKINS-33508 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-47426 [ JENKINS-47426 ]
            Hide
            wfollonier Wadeck Follonier added a comment -

            Antonio Muñiz for your information I proposed a PR #3082 with only the administrative monitor that was the part everyone seems to agree on.

            Show
            wfollonier Wadeck Follonier added a comment - Antonio Muñiz for your information I proposed a PR #3082  with only the administrative monitor that was the part everyone seems to agree on.
            recampbell Ryan Campbell made changes -
            Assignee Antonio Muñiz [ amuniz ] Wadeck Follonier [ wfollonier ]
            recampbell Ryan Campbell made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            recampbell Ryan Campbell made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            recampbell Ryan Campbell made changes -
            Description 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).

            Two things to improve it:

            # Don't set the value in the field, but suggest it (form validation)
            # Add an administrative monitor pointing to it
            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:

            # -Don't set the value in the field, but suggest it (form validation)-
            # Add an administrative monitor pointing to it
            Hide
            recampbell Ryan Campbell added a comment -

            Adjusted scope to reflect the step we are taking now, which is what Wadeck's PR addresses. Further changes can be filed as new issues.

            Show
            recampbell Ryan Campbell added a comment - Adjusted scope to reflect the step we are taking now, which is what Wadeck's PR addresses. Further changes can be filed as new issues.
            wfollonier Wadeck Follonier made changes -
            Remote Link This issue links to "#3082 (Web Link)" [ 17948 ]
            jglick Jesse Glick made changes -
            Labels ux essentials ux
            danielbeck Daniel Beck made changes -
            Link This issue is duplicated by JENKINS-28466 [ JENKINS-28466 ]
            wfollonier Wadeck Follonier made changes -
            Resolution Fixed [ 1 ]
            Status In Review [ 10005 ] Resolved [ 5 ]
            Hide
            pmilliken 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.

            Show
            pmilliken 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.
            Hide
            wfollonier Wadeck Follonier added a comment - - edited

            Paul Milliken 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).
            Show
            wfollonier Wadeck Follonier added a comment - - edited Paul Milliken 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).
            Hide
            ok2332 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.

            Show
            ok2332 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.
            Hide
            wfollonier Wadeck Follonier added a comment - - edited

            Omar Kohl 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.

            Show
            wfollonier Wadeck Follonier added a comment - - edited Omar Kohl 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.
            Hide
            ok2332 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...

            Show
            ok2332 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...
            Hide
            wfollonier Wadeck Follonier added a comment -

            Omar Kohl 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.

            Show
            wfollonier Wadeck Follonier added a comment - Omar Kohl 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.
            Hide
            wfollonier Wadeck Follonier added a comment - - edited

            Paul Milliken Omar Kohl 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.

            Show
            wfollonier Wadeck Follonier added a comment - - edited Paul Milliken Omar Kohl 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.
            danielbeck Daniel Beck made changes -
            Comment [ The Jenkins weekly release that contains the fix for this, 2.119, has references this issue in community feedback, and it's unclear why.

            *If you experience problems related to this change, please file a new issue describing those problems, and link to it.* ]
            Hide
            danielbeck Daniel Beck added a comment -

            Wadeck Follonier 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?

            Show
            danielbeck Daniel Beck added a comment - Wadeck Follonier 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?
            Hide
            pmilliken Paul Milliken added a comment - - edited

            Wadeck Follonier 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.

            Show
            pmilliken Paul Milliken added a comment - - edited Wadeck Follonier 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.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

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

            Show
            oleg_nenashev Oleg Nenashev added a comment - Hit it on my instance as well. Will link the ticket to JENKINS-51064 properly
            oleg_nenashev Oleg Nenashev made changes -
            Link This issue relates to JENKINS-51064 [ JENKINS-51064 ]
            jglick Jesse Glick made changes -
            Link This issue is blocked by JENKINS-51660 [ JENKINS-51660 ]
            egutierrez Evaristo Gutierrez made changes -
            Link This issue is blocked by JENKINS-51816 [ JENKINS-51816 ]
            batmat Baptiste Mathus made changes -
            Labels essentials ux essentials evergreen ux
            batmat Baptiste Mathus made changes -
            Labels essentials evergreen ux evergreen ux
            jglick Jesse Glick made changes -
            Link This issue causes JENKINS-60750 [ JENKINS-60750 ]

              People

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

                Dates

                Created:
                Updated:
                Resolved: