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

null permission lookup when pull-request's origin repo/branch is deleted on github

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None

      We use GitHub Organizations to manage our jobs.

      We found a bug where if a pull request has its source repository/branch deleted (e.g. it was a personal fork and that personal fork was deleted) then that repository stops updating from github.

      Here is the log from the "Scan Repository Log':

          Checking pull request #154
      ERROR: [Fri Apr 12 16:39:29 EDT 2019] Could not fetch branches from source org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator::https://github.example.com/api/v3::robert-continuous-delivery::howard
      java.io.FileNotFoundException: https://github.example.com/api/v3/repos/robert-continuous-delivery/howard/collaborators/null/permission
      	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:625)
      	at org.kohsuke.github.Requester.parse(Requester.java:607)
      	at org.kohsuke.github.Requester._to(Requester.java:285)
      Caused: org.kohsuke.github.GHFileNotFoundException: {"message":"null is not a user","documentation_url":"https://developer.github.com/enterprise/2.16/v3/repos/collaborators/#review-a-users-permission-level"}
      	at org.kohsuke.github.Requester.handleApiError(Requester.java:699)
      	at org.kohsuke.github.Requester._to(Requester.java:306)
      	at org.kohsuke.github.Requester.to(Requester.java:247)
      	at org.kohsuke.github.GHRepository.getPermission(GHRepository.java:529)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$1.fetch(GitHubSCMSource.java:904)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSourceRequest.getPermissions(GitHubSCMSourceRequest.java:474)
      	at org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait$TrustPermission.checkTrusted(ForkPullRequestDiscoveryTrait.java:344)
      	at org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait$TrustPermission.checkTrusted(ForkPullRequestDiscoveryTrait.java:327)
      	at jenkins.scm.api.trait.SCMHeadAuthority.isTrusted(SCMHeadAuthority.java:101)
      	at jenkins.scm.api.trait.SCMSourceRequest.isTrusted(SCMSourceRequest.java:213)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$3.create(GitHubSCMSource.java:970)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$3.create(GitHubSCMSource.java:964)
      	at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:339)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:960)
      	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373)
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:283)
      	at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:634)
      	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277)
      	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
      	at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1025)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:429)
      [Fri Apr 12 16:39:29 EDT 2019] Finished branch indexing. Indexing took 3.6 sec
      FATAL: Failed to recompute children of Jenkins: Continuous Delivery » howard
      org.kohsuke.github.GHFileNotFoundException: {"message":"null is not a user","documentation_url":"https://developer.github.com/enterprise/2.16/v3/repos/collaborators/#review-a-users-permission-level"}
      	at org.kohsuke.github.Requester.handleApiError(Requester.java:699)
      	at org.kohsuke.github.Requester._to(Requester.java:306)
      	at org.kohsuke.github.Requester.to(Requester.java:247)
      	at org.kohsuke.github.GHRepository.getPermission(GHRepository.java:529)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$1.fetch(GitHubSCMSource.java:904)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSourceRequest.getPermissions(GitHubSCMSourceRequest.java:474)
      	at org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait$TrustPermission.checkTrusted(ForkPullRequestDiscoveryTrait.java:344)
      	at org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait$TrustPermission.checkTrusted(ForkPullRequestDiscoveryTrait.java:327)
      	at jenkins.scm.api.trait.SCMHeadAuthority.isTrusted(SCMHeadAuthority.java:101)
      	at jenkins.scm.api.trait.SCMSourceRequest.isTrusted(SCMSourceRequest.java:213)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$3.create(GitHubSCMSource.java:970)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$3.create(GitHubSCMSource.java:964)
      	at jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:339)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:960)
      	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373)
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:283)
      	at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:634)
      	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277)
      	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
      	at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1025)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:429)
      Caused by: java.io.FileNotFoundException: https://github.example.com/api/v3/repos/robert-continuous-delivery/howard/collaborators/null/permission
      	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:625)
      	at org.kohsuke.github.Requester.parse(Requester.java:607)
      	at org.kohsuke.github.Requester._to(Requester.java:285)
      	... 20 more
      Finished: FAILURE
      

          [JENKINS-56996] null permission lookup when pull-request's origin repo/branch is deleted on github

          Christian Höltje created issue -
          Liam Newman made changes -
          Assignee New: Liam Newman [ bitwiseman ]
          Liam Newman made changes -
          Assignee Original: Liam Newman [ bitwiseman ]
          Liam Newman made changes -
          Assignee New: Liam Newman [ bitwiseman ]
          Liam Newman made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Liam Newman made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Liam Newman made changes -
          Remote Link New: This issue links to "PR-224 (Web Link)" [ 22753 ]
          Liam Newman made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Resolved [ 5 ]
          Liam Newman made changes -
          Link New: This issue is related to JENKINS-57492 [ JENKINS-57492 ]
          Allan BURDAJEWICZ made changes -
          Link New: This issue relates to JENKINS-73791 [ JENKINS-73791 ]

            bitwiseman Liam Newman
            docwhat Christian Höltje
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: