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

Organization Scan hangs on anonymous rate limits checking for private mode

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • github-branch-source:1656
    • github-branch-source:1725.vd391eef681a_e

      The Organization Scan of a GitHub Organization item may hang on rate limit of the unauthenticated user:

      "Executor #-1 for Built-In Node : executing OrganizationScan[path/to/my/orgitem]" [...]
         java.lang.Thread.State: TIMED_WAITING (sleeping)
      	at java.lang.Thread.sleep(java.base@11.0.16/Native Method)
      	at org.kohsuke.github.RateLimitHandler$1.onError(RateLimitHandler.java:74)
      	at org.kohsuke.github.RateLimitHandler.onError(RateLimitHandler.java:43)
      	at org.kohsuke.github.GitHubClient.detectKnownErrors(GitHubClient.java:417)
      	at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:386)
      	at org.kohsuke.github.GitHubClient.fetch(GitHubClient.java:121)
      	at org.kohsuke.github.GitHubClient.checkApiUrlValidity(GitHubClient.java:323)
      	at org.kohsuke.github.GitHub.checkApiUrlValidity(GitHub.java:1244)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator.determinePrivateMode(GitHubSCMNavigator.java:1677)
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator.retrieveActions(GitHubSCMNavigator.java:1644)
      	at jenkins.scm.api.SCMNavigator.fetchActions(SCMNavigator.java:332)
      	at jenkins.branch.OrganizationFolder.computeChildren(OrganizationFolder.java:487)
      	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:278)
      	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:166)
      	at jenkins.branch.OrganizationFolder$OrganizationScan.run(OrganizationFolder.java:918)
      	at hudson.model.ResourceController.execute(ResourceController.java:101)
      	at hudson.model.Executor.run(Executor.java:442)
      

      The plugin makes an unauthenticated call to check on private mode https://github.com/jenkinsci/github-branch-source-plugin/blob/1656.v77eddb_b_e95df/src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java#L1677 since version 1599 which I think might be related.

          [JENKINS-69815] Organization Scan hangs on anonymous rate limits checking for private mode

          Allan BURDAJEWICZ created issue -
          Allan BURDAJEWICZ made changes -
          Environment Original: github-branch-source: New: github-branch-source:1656

          Allan BURDAJEWICZ added a comment - - edited

          We can't just revert the change. A solution might be to implement a AvatarCacheSource to retrieve the image in an authenticated way and cache it. Or for a quick workaround, let the user configure whether he want to fetch the avatar in the GitHubSCMNavigator (with a checkbox for example, but maybe that would be an scm-api thing in such a case...) ?

          Allan BURDAJEWICZ added a comment - - edited We can't just revert the change. A solution might be to implement a AvatarCacheSource to retrieve the image in an authenticated way and cache it. Or for a quick workaround, let the user configure whether he want to fetch the avatar in the GitHubSCMNavigator (with a checkbox for example, but maybe that would be an scm-api thing in such a case...) ?
          Allan BURDAJEWICZ made changes -
          Assignee New: rsandell [ rsandell ]
          Allan BURDAJEWICZ made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Allan BURDAJEWICZ made changes -
          Released As New: github-branch-source:1725.vd391eef681a_e
          Resolution New: Fixed [ 1 ]
          Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
          Allan BURDAJEWICZ made changes -
          Link New: This issue is related to JENKINS-72030 [ JENKINS-72030 ]

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

              Created:
              Updated:
              Resolved: