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

GitHub branches with hash in name fail to build

    XMLWordPrintable

Details

    Description

      I'm not sure when exactly this has started happening, but I've noticed last week that GitHub branches with a hash (#) in the name fail to build in pipeline jobs.

      From the logs it looks like the hash should be url encoded, but isn't. I'm pretty sure this was working before though so not sure what's going on.

      Relevant stack trace. Branch name in question is feature/#1234/xxx (redacted):

      ERROR: {"message":"Branch not found","documentation_url":"https://developer.github.com/v3/repos/#get-branch"}
      java.io.FileNotFoundException: https://api.github.com/repos/xxx/xxx/branches/feature/#1234/xxx
      	at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:243)
      	at com.squareup.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210)
      	at com.squareup.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:25)
      	at org.kohsuke.github.Requester.parse(Requester.java:602)
      	at org.kohsuke.github.Requester.parse(Requester.java:584)
      	at org.kohsuke.github.Requester._to(Requester.java:264)
      Caused: java.io.FileNotFoundException: {"message":"Branch not found","documentation_url":"https://developer.github.com/v3/repos/#get-branch"}
      	at org.kohsuke.github.Requester.handleApiError(Requester.java:660)
      	at org.kohsuke.github.Requester._to(Requester.java:285)
      	at org.kohsuke.github.Requester.to(Requester.java:226)
      	at org.kohsuke.github.GHRepository.getBranch(GHRepository.java:1234)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$LazyBranches.create(GitHubSCMSource.java:1773)
      	at org.jenkinsci.plugins.github_branch_source.LazyIterable.iterator(LazyIterable.java:57)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:869)
      	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:355)
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:309)
      

      Attachments

        Issue Links

          Activity

            johnhamelink john hamelink added a comment -

            We've also been experiencing this bug, except for us it seems to affect pulling down data on tags. This is currently affecting our ability to build pull requests from Github.

            [Wed Oct 04 14:13:00 BST 2017] Push event to branch refs/tags/version8.5.238 in repository url/api-2.1 CREATED event from 192.30.252.40 ⇒
            http://ci.url.com:8080/github-webhook/
            with timestamp Wed Oct 04 14:12:54 BST 2017 processed in 0.8 sec 14:13:00 Connecting to https://api.github.com using johnhamelink/****** (Github Personal Access Token (2)) Examining
            url/api-2.1
            Checking branches... Getting remote branch refs/tags/version8.5.238... ERROR: {"message":"Branch not found","documentation_url":"
            https://developer.github.com/v3/repos/branches/#get-branch
            "} java.io.FileNotFoundException:
            https://api.github.com/repos/url/api-2.1/branches/refs/tags/version8.5.238
            at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:243) at com.squareup.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210) at com.squareup.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:25) at org.kohsuke.github.Requester.parse(Requester.java:612) at org.kohsuke.github.Requester.parse(Requester.java:594) at org.kohsuke.github.Requester._to(Requester.java:272) Caused: org.kohsuke.github.GHFileNotFoundException: {"message":"Branch not found","documentation_url":"
            https://developer.github.com/v3/repos/branches/#get-branch
            "} at org.kohsuke.github.Requester.handleApiError(Requester.java:686) at org.kohsuke.github.Requester._to(Requester.java:293) at org.kohsuke.github.Requester.to(Requester.java:234) at org.kohsuke.github.GHRepository.getBranch(GHRepository.java:1305) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$LazyBranches.create(GitHubSCMSource.java:1773) at org.jenkinsci.plugins.github_branch_source.LazyIterable.iterator(LazyIterable.java:57) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:869) at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:355) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:309) at jenkins.branch.MultiBranchProject$SCMEventListenerImpl.processHeadCreate(MultiBranchProject.java:1300) at jenkins.branch.MultiBranchProject$SCMEventListenerImpl.onSCMHeadEvent(MultiBranchProject.java:1134) at jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:247) at jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:230) at jenkins.scm.api.SCMEvent$Dispatcher.run(SCMEvent.java:481) at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) [Wed Oct 04 14:13:00 BST 2017] Push event to branch refs/tags/version8.5.238 in repository url/api-2.1 CREATED event from 192.30.252.40 ⇒
            http://ci.url.com:8080/github-webhook/
            with timestamp Wed Oct 04 14:12:54 BST 2017 processed in 0.8 sec
            johnhamelink john hamelink added a comment - We've also been experiencing this bug, except for us it seems to affect pulling down data on tags. This is currently affecting our ability to build pull requests from Github. [Wed Oct 04 14:13:00 BST 2017] Push event to branch refs/tags/version8.5.238 in repository url/api-2.1 CREATED event from 192.30.252.40 ⇒ http: //ci.url.com:8080/github-webhook/ with timestamp Wed Oct 04 14:12:54 BST 2017 processed in 0.8 sec 14:13:00 Connecting to https: //api.github.com using johnhamelink/****** (Github Personal Access Token (2)) Examining url/api-2.1 Checking branches... Getting remote branch refs/tags/version8.5.238... ERROR: { "message" : "Branch not found" , "documentation_url" :" https: //developer.github.com/v3/repos/branches/#get-branch "} java.io.FileNotFoundException: https: //api.github.com/repos/url/api-2.1/branches/refs/tags/version8.5.238 at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:243) at com.squareup.okhttp.internal.huc.DelegatingHttpsURLConnection.getInputStream(DelegatingHttpsURLConnection.java:210) at com.squareup.okhttp.internal.huc.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:25) at org.kohsuke.github.Requester.parse(Requester.java:612) at org.kohsuke.github.Requester.parse(Requester.java:594) at org.kohsuke.github.Requester._to(Requester.java:272) Caused: org.kohsuke.github.GHFileNotFoundException: { "message" : "Branch not found" , "documentation_url" :" https: //developer.github.com/v3/repos/branches/#get-branch "} at org.kohsuke.github.Requester.handleApiError(Requester.java:686) at org.kohsuke.github.Requester._to(Requester.java:293) at org.kohsuke.github.Requester.to(Requester.java:234) at org.kohsuke.github.GHRepository.getBranch(GHRepository.java:1305) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$LazyBranches.create(GitHubSCMSource.java:1773) at org.jenkinsci.plugins.github_branch_source.LazyIterable.iterator(LazyIterable.java:57) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:869) at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:355) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:309) at jenkins.branch.MultiBranchProject$SCMEventListenerImpl.processHeadCreate(MultiBranchProject.java:1300) at jenkins.branch.MultiBranchProject$SCMEventListenerImpl.onSCMHeadEvent(MultiBranchProject.java:1134) at jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:247) at jenkins.scm.api.SCMHeadEvent$DispatcherImpl.fire(SCMHeadEvent.java:230) at jenkins.scm.api.SCMEvent$Dispatcher.run(SCMEvent.java:481) at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang. Thread .run( Thread .java:748) [Wed Oct 04 14:13:00 BST 2017] Push event to branch refs/tags/version8.5.238 in repository url/api-2.1 CREATED event from 192.30.252.40 ⇒ http: //ci.url.com:8080/github-webhook/ with timestamp Wed Oct 04 14:12:54 BST 2017 processed in 0.8 sec
            stephenconnolly Stephen Connolly added a comment - https://github.com/kohsuke/github-api/issues/381

            People

              Unassigned Unassigned
              pascalw Pascal Widdershoven
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: