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

    XMLWordPrintable

Details

    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

          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)

          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)

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

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

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

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

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

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

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

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

          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

          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

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

            Dates

              Created:
              Updated:
              Resolved: