• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • github-plugin
    • None
    • eks, amazon-linux, docker, jenkins-war:2.190.3

      Trying to override the Jenkins url at "override hook url" is failing.
      The adrress is not being saved and the original Jenkins url is showed instead.

      This happen manually at the ui.
      After further checking it is working using Jenkins configuration as code plugin.

          [JENKINS-60738] Override github hook url is not being saved

          We are hitting the same issue. So far the only ways we have found around this is by using configuration as code and/or running a console script to update the plugin's XML file to add the XML into it (then restarting Jenkins).

          Allen Servedio added a comment - We are hitting the same issue. So far the only ways we have found around this is by using configuration as code and/or running a console script to update the plugin's XML file to add the XML into it (then restarting Jenkins).

          Evan Bluhm added a comment -

          I've found that reverting the github-plugin to 1.29.4 lets me save/edit the override hook url. I'm very suspicious that https://github.com/jenkinsci/github-plugin/pull/221 has unintentionally broken some functionality in the /configure page.

          Evan Bluhm added a comment - I've found that reverting the github-plugin to 1.29.4 lets me save/edit the override hook url. I'm very suspicious that https://github.com/jenkinsci/github-plugin/pull/221  has unintentionally broken some functionality in the /configure page.

          Having the same problem. If I want to change "Override Hook URL" through UI, it is now saved.

          In the end, hooks cannot be created automatically because URL with "localhost" inside cannot be accessed from git. Obviously...
          I will try to use groovy or CasC but this cannot be a permanent solution.

          Failed to add GitHub webhook for GitHubRepositoryName[host=github.com,username=CloudMondo,repository=grafana-dashboards] java.io.FileNotFoundException: https://api.github.com/repos/CloudMondo/grafana-dashboards/hooks at org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory$OkHttpURLConnection.getInputStream(ObsoleteUrlFactory.java:488) at org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory$DelegatingHttpsURLConnection.getInputStream(ObsoleteUrlFactory.java:1201) at org.kohsuke.github.GitHubHttpUrlConnectionClient$HttpURLConnectionResponseInfo.bodyStream(GitHubHttpUrlConnectionClient.java:197) at org.kohsuke.github.GitHubResponse$ResponseInfo.getBodyAsString(GitHubResponse.java:326) at org.kohsuke.github.GitHubResponse.parseBody(GitHubResponse.java:91) at org.kohsuke.github.Requester.lambda$fetch$1(Requester.java:74) at org.kohsuke.github.GitHubClient.createResponse(GitHubClient.java:461) at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:412) Caused: org.kohsuke.github.GHFileNotFoundException: https://api.github.com/repos/CloudMondo/grafana-dashboards/hooks {"message":"Validation Failed","errors":[{"resource":"Hook","code":"custom","message":"Sorry, the URL host localhost is not supported because it isn't reachable over the public Internet"}],"documentation_url":"https://docs.github.com/rest/reference/repos#create-a-repository-webhook"} at org.kohsuke.github.GitHubClient.interpretApiError(GitHubClient.java:492) at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:420) at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:363) at org.kohsuke.github.Requester.fetch(Requester.java:74) at org.kohsuke.github.GHHooks$Context.createHook(GHHooks.java:86) at org.kohsuke.github.GHRepository.createHook(GHRepository.java:2087) at org.jenkinsci.plugins.github.webhook.WebhookManager$9.applyNullSafe(WebhookManager.java:349) Caused: org.kohsuke.github.GHException: Failed to create hook at org.jenkinsci.plugins.github.webhook.WebhookManager$9.applyNullSafe(WebhookManager.java:351) at org.jenkinsci.plugins.github.webhook.WebhookManager$9.applyNullSafe(WebhookManager.java:334) at org.jenkinsci.plugins.github.util.misc.NullSafeFunction.apply(NullSafeFunction.java:18) at org.jenkinsci.plugins.github.webhook.WebhookManager$2.applyNullSafe(WebhookManager.java:222) at org.jenkinsci.plugins.github.webhook.WebhookManager$2.applyNullSafe(WebhookManager.java:193)
          

          Primož Prislan added a comment - Having the same problem. If I want to change "Override Hook URL" through UI, it is now saved. In the end, hooks cannot be created automatically because URL with "localhost" inside cannot be accessed from git. Obviously... I will try to use groovy or CasC but this cannot be a permanent solution. Failed to add GitHub webhook for GitHubRepositoryName[host=github.com,username=CloudMondo,repository=grafana-dashboards] java.io.FileNotFoundException: https: //api.github.com/repos/CloudMondo/grafana-dashboards/hooks at org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory$OkHttpURLConnection.getInputStream(ObsoleteUrlFactory.java:488) at org.kohsuke.github.extras.okhttp3.ObsoleteUrlFactory$DelegatingHttpsURLConnection.getInputStream(ObsoleteUrlFactory.java:1201) at org.kohsuke.github.GitHubHttpUrlConnectionClient$HttpURLConnectionResponseInfo.bodyStream(GitHubHttpUrlConnectionClient.java:197) at org.kohsuke.github.GitHubResponse$ResponseInfo.getBodyAsString(GitHubResponse.java:326) at org.kohsuke.github.GitHubResponse.parseBody(GitHubResponse.java:91) at org.kohsuke.github.Requester.lambda$fetch$1(Requester.java:74) at org.kohsuke.github.GitHubClient.createResponse(GitHubClient.java:461) at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:412) Caused: org.kohsuke.github.GHFileNotFoundException: https://api.github.com/repos/CloudMondo/grafana-dashboards/hooks { "message" : "Validation Failed" , "errors" :[{ "resource" : "Hook" , "code" : "custom" , "message" : "Sorry, the URL host localhost is not supported because it isn't reachable over the public Internet" }], "documentation_url" : "https://docs.github.com/ rest /reference/repos#create-a-repository-webhook" } at org.kohsuke.github.GitHubClient.interpretApiError(GitHubClient.java:492) at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:420) at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:363) at org.kohsuke.github.Requester.fetch(Requester.java:74) at org.kohsuke.github.GHHooks$Context.createHook(GHHooks.java:86) at org.kohsuke.github.GHRepository.createHook(GHRepository.java:2087) at org.jenkinsci.plugins.github.webhook.WebhookManager$9.applyNullSafe(WebhookManager.java:349) Caused: org.kohsuke.github.GHException: Failed to create hook at org.jenkinsci.plugins.github.webhook.WebhookManager$9.applyNullSafe(WebhookManager.java:351) at org.jenkinsci.plugins.github.webhook.WebhookManager$9.applyNullSafe(WebhookManager.java:334) at org.jenkinsci.plugins.github.util.misc.NullSafeFunction.apply(NullSafeFunction.java:18) at org.jenkinsci.plugins.github.webhook.WebhookManager$2.applyNullSafe(WebhookManager.java:222) at org.jenkinsci.plugins.github.webhook.WebhookManager$2.applyNullSafe(WebhookManager.java:193)

          Jason added a comment -

          Same issue here on Jenkins 2.277.4. If I set Override Hook URL via the UI (under Manage Jenkins > Configure System) and hit Save, then come back to it, the Override Hook URL is cleared out and did not actually save. No relevant log messages in Jenkins System Logs.

          Jason added a comment - Same issue here on Jenkins 2.277.4. If I set Override Hook URL via the UI (under Manage Jenkins > Configure System) and hit Save, then come back to it, the Override Hook URL is cleared out and did not actually save. No relevant log messages in Jenkins System Logs.

          Peter Mount added a comment -

          I've just hit the same issue. Got Jenkins running on an internal docker container (2.289.3 LTS) and an external proxy to pass github webhooks into it.

          Webhooks work when manually configured at GitHub, but in the plugin (1.34.0) the override hook url is, like Jason above, cleared out after you save it so when you perform a re-register hooks github gets the internal jenkins address not the proxy.

          Peter Mount added a comment - I've just hit the same issue. Got Jenkins running on an internal docker container (2.289.3 LTS) and an external proxy to pass github webhooks into it. Webhooks work when manually configured at GitHub, but in the plugin (1.34.0) the override hook url is, like Jason above, cleared out after you save it so when you perform a re-register hooks github gets the internal jenkins address not the proxy.

          Don Kallman added a comment - - edited

          We are experiencing the same issue on 2.303.3.3 and 2.263.2.2.

          Don Kallman added a comment - - edited We are experiencing the same issue on 2.303.3.3 and 2.263.2.2.

          Always Fail added a comment -

          I'm also experiencing this issue. I can't seem to be able to update the webhook URL after changing the domain of my instance. How can this be worked around?

          Always Fail added a comment - I'm also experiencing this issue. I can't seem to be able to update the webhook URL after changing the domain of my instance. How can this be worked around?

          Always Fail added a comment -

          It appears the value can be changed in github-plugin-configuration.xml config file under hookUrl key.

          Always Fail added a comment - It appears the value can be changed in github-plugin-configuration.xml config file under hookUrl key.

          Rob added a comment -

          This issue is still present: took me 24 hours of pain while setting up a new system only to find that the goldarned GUI of the Github plugin is broken, and it has been broken since 2020!?!  Unh?

          Rob added a comment - This issue is still present: took me 24 hours of pain while setting up a new system only to find that the goldarned GUI of the Github plugin is broken, and it has been broken since 2020!?!  Unh?

          Allan BURDAJEWICZ added a comment - Proposed https://github.com/jenkinsci/github-plugin/pull/347

            allan_burdajewicz Allan BURDAJEWICZ
            avihayt Avihay Tsayeg
            Votes:
            17 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated: