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

When "origin branches also filed as PRs" is set, FileNotFoundException from malformed GitHub "open PR" query

    Details

    • Similar Issues:

      Description

      When trying to re-scan our GitHub Org, and we have set the "Build origin branches also filed as PRs" or really any of the "origin PR" settings, I see the following exception:

      Nov 01, 2016 3:02:06 AM SEVERE hudson.model.Executor finish1
      Executor threw an exception
      java.lang.Error: java.io.FileNotFoundException: {"message":"Server Error","documentation_url":"https://developer.github.com/v3"}
      	at org.kohsuke.github.Requester$PagingIterator.fetch(Requester.java:433)
      	at org.kohsuke.github.Requester$PagingIterator.hasNext(Requester.java:400)
      	at org.kohsuke.github.PagedIterator.fetch(PagedIterator.java:44)
      	at org.kohsuke.github.PagedIterator.hasNext(PagedIterator.java:32)
      	at org.kohsuke.github.PagedIterable.asList(PagedIterable.java:42)
      	at org.kohsuke.github.GHRepository.getPullRequests(GHRepository.java:648)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.doRetrieve(GitHubSCMSource.java:381)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:365)
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:148)
      	at jenkins.scm.api.SCMSource.retrieve(SCMSource.java:232)
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:177)
      	at jenkins.branch.MultiBranchProjectFactory$BySCMSourceCriteria$1.call(MultiBranchProjectFactory.java:157)
      	at jenkins.branch.MultiBranchProjectFactory$BySCMSourceCriteria$1.call(MultiBranchProjectFactory.java:154)
      	at jenkins.branch.OrganizationFolder.withSCMSourceCriteria(OrganizationFolder.java:255)
      	at jenkins.branch.MultiBranchProjectFactory$BySCMSourceCriteria.recognizes(MultiBranchProjectFactory.java:154)
      	at jenkins.branch.OrganizationFolder$1$1.complete(OrganizationFolder.java:165)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator.add(GitHubSCMNavigator.java:323)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator.visitSources(GitHubSCMNavigator.java:276)
      	at jenkins.branch.OrganizationFolder.computeChildren(OrganizationFolder.java:125)
      	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:157)
      	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:122)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:401)
      Caused by: java.io.FileNotFoundException: {"message":"Server Error","documentation_url":"https://developer.github.com/v3"}
      	at org.kohsuke.github.Requester.handleApiError(Requester.java:592)
      	at org.kohsuke.github.Requester$PagingIterator.fetch(Requester.java:429)
      	... 22 more
      Caused by: java.io.FileNotFoundException: https://api.github.com/repos/terradatum/node-spritesheet/pulls?state=open
      	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:524)
      	at org.kohsuke.github.Requester.access$200(Requester.java:68)
      	at org.kohsuke.github.Requester$PagingIterator.fetch(Requester.java:424)
      	... 22 more
      

      And when I try the URL seen in the exception: https://api.github.com/repos/terradatum/node-spritesheet/pulls?state=open

      I see the following:

      {
        "message": "Server Error",
        "documentation_url": "https://developer.github.com/v3"
      }
      

      The symptom on the UI is the "Failure: NOT_BUILT" status.

      Yes the automation user connecting to our GitHub org is an admin in the org. No, this is not the typical case where the plugin is failing to create, or delete, or even see the hook - this is about a failed API call to GitHub when the plugin is looking for open PRs.

      Maybe a regression introduced during the JENKINS-37253 fix?

        Attachments

          Activity

          Hide
          stephenconnolly Stephen Connolly added a comment -

          The GitHub Org Folders plugin is being tombstoned.

          The functionality provided by the GitHub Org Folders plugin has been significantly refactored and migrated to the GitHub Branch Source plugin.

          Please verify if this issue is an issue with GitHub Branch Source 2.0.0-beta-1 (available from the experimental update center now or 2.0.0 (available in early January 2017)

          Show
          stephenconnolly Stephen Connolly added a comment - The GitHub Org Folders plugin is being tombstoned. The functionality provided by the GitHub Org Folders plugin has been significantly refactored and migrated to the GitHub Branch Source plugin. Please verify if this issue is an issue with GitHub Branch Source 2.0.0-beta-1 (available from the experimental update center now or 2.0.0 (available in early January 2017)
          Hide
          rbellamy G. Richard Bellamy added a comment -

          Stephen Connolly I just added the experimental update center to my Jenkins host and I'm not seeing the GitHub Branch Source option?

          Show
          rbellamy G. Richard Bellamy added a comment - Stephen Connolly I just added the experimental update center to my Jenkins host and I'm not seeing the GitHub Branch Source option?
          Hide
          rbellamy G. Richard Bellamy added a comment -

          Could it be because it's called the "Branch API plugin"?

          Show
          rbellamy G. Richard Bellamy added a comment - Could it be because it's called the "Branch API plugin"?
          Hide
          rbellamy G. Richard Bellamy added a comment -

          Found it... the filter built into the plugin manager wasn't finding it... actually had to use the "Find in page" functionality of my browser...

          Show
          rbellamy G. Richard Bellamy added a comment - Found it... the filter built into the plugin manager wasn't finding it... actually had to use the "Find in page" functionality of my browser...
          Hide
          stephenconnolly Stephen Connolly added a comment -

          It should have been showing up on the updates tab if you have the previous one installed

          Show
          stephenconnolly Stephen Connolly added a comment - It should have been showing up on the updates tab if you have the previous one installed
          Hide
          stephenconnolly Stephen Connolly added a comment -

          Please be advised that you will need to either upgrade to the GHOF tombstone release 1.6-beta-1 or uninstall the GHOF plugin

          Recommended is to upgrade to the GHOF tombstone if you have GHOF installed as that will migrate your data... then after all projects have been indexed once you can uninstall the GHOF plugin

          Show
          stephenconnolly Stephen Connolly added a comment - Please be advised that you will need to either upgrade to the GHOF tombstone release 1.6-beta-1 or uninstall the GHOF plugin Recommended is to upgrade to the GHOF tombstone if you have GHOF installed as that will migrate your data... then after all projects have been indexed once you can uninstall the GHOF plugin

            People

            • Assignee:
              kohsuke Kohsuke Kawaguchi
              Reporter:
              rbellamy G. Richard Bellamy
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: