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

Branch Indexing interrupted if failing to populate Origin user details

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • github-branch-source:1793.v1831e9c68d77

      Branch Indexing is interrupted when trying to get more metadata from the origin branch / PR user:

      ERROR: [Tue Sept 17 15:28:39 AEST 2024] Could not fetch branches from source [...]
      [Tue Sept 17 15:28:39 AEST 2024] Finished branch indexing. Indexing took 3.4 sec
      FATAL: Failed to recompute children of ateam ยป arepo
      java.io.FileNotFoundException: https://api.github.com/users/renovate%5Bbot%5D
      	at PluginClassLoader for github-api//org.kohsuke.github.GitHubConnectorResponseErrorHandler$1.onError(GitHubConnectorResponseErrorHandler.java:68)
      	at PluginClassLoader for github-api//org.kohsuke.github.GitHubClient.detectKnownErrors(GitHubClient.java:504)
      	at PluginClassLoader for github-api//org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:464)
      Caused: org.kohsuke.github.GHFileNotFoundException: https://api.github.com/users/renovate%5Bbot%5D {"message":"Not Found","documentation_url":"https://docs.github.com/rest","status":"404"}
      	at PluginClassLoader for github-api//org.kohsuke.github.GitHubClient.interpretApiError(GitHubClient.java:735)
      	at PluginClassLoader for github-api//org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:480)
      	at PluginClassLoader for github-api//org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:427)
      	at PluginClassLoader for github-api//org.kohsuke.github.Requester.fetchInto(Requester.java:102)
      	at PluginClassLoader for github-api//org.kohsuke.github.GHPerson.populate(GHPerson.java:60)
      	at PluginClassLoader for github-api//org.kohsuke.github.GHPerson.getName(GHPerson.java:208)
      	at PluginClassLoader for github-branch-source//org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$LazyPullRequests$CacheUpdatingIterable.observe(GitHubSCMSource.java:2564)
      	at PluginClassLoader for github-branch-source//org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$LazyPullRequests$CacheUpdatingIterable.observe(GitHubSCMSource.java:2542)
      	at PluginClassLoader for github-branch-source//org.jenkinsci.plugins.github_branch_source.SinglePassIterable$1.next(SinglePassIterable.java:91)
      	at PluginClassLoader for github-branch-source//org.jenkinsci.plugins.github_branch_source.BranchDiscoveryTrait$ExcludeOriginPRBranchesSCMHeadFilter.isExcluded(BranchDiscoveryTrait.java:219)
      	at PluginClassLoader for scm-api//jenkins.scm.api.trait.SCMSourceRequest.isExcluded(SCMSourceRequest.java:196)
      	at PluginClassLoader for scm-api//jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:333)
      	at PluginClassLoader for scm-api//jenkins.scm.api.trait.SCMSourceRequest.process(SCMSourceRequest.java:249)
      	at PluginClassLoader for github-branch-source//org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1042)
      	at PluginClassLoader for scm-api//jenkins.scm.api.SCMSource._retrieve(SCMSource.java:372)
      	at PluginClassLoader for scm-api//jenkins.scm.api.SCMSource.fetch(SCMSource.java:282)
      	at PluginClassLoader for branch-api//jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:654)
      	at PluginClassLoader for cloudbees-folder//com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:269)
      	at PluginClassLoader for cloudbees-folder//com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:167)
      	at PluginClassLoader for branch-api//jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1057)
      	at hudson.model.ResourceController.execute(ResourceController.java:101)
      	at hudson.model.Executor.run(Executor.java:447)
      Finished: FAILURE
      

      A single PR may interrupt the entire indexing for information that is not crucial. Actually the code mentions that the error should just warn and continue, though it raise an exception: https://github.com/jenkinsci/github-branch-source-plugin/blob/1797.v86fdb_4d57d43/src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java#L2569-L2575..

      It looks like this is not always handled..

      In the context of a PR fetch this seems to be caught and not breaking the indexing:

      But when in the context of a branch fetch (that will go through the iterable to check if it needs to be excluded) it is not:

      This issue can be quite impactful as GitHub API. It has been observed in some environments that requests to user information sporadically fail with 404.. For example with the publicly available user URL: https://api.github.com/users/renovate%5Bbot%5D

            allan_burdajewicz Allan BURDAJEWICZ
            allan_burdajewicz Allan BURDAJEWICZ
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: