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

Unauthenticated request to GitHub trigger rate limits when adding organization

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • Jenkins 2.16
      GitHub API Plugin 1.76
      GitHub Branch Source Plugin 1.8.1
      GitHub Organization Folder Plugin 1.4
      GitHub plugin 1.20.0
      Pipeline 2.2

      When adding a new GitHub organization, the initial attempts to create access it and create the GH webhooks do not seem to be authenticated, triggering GH's rate limits.

      Aug 04, 2016 8:45:10 PM org.jenkinsci.plugins.orgfolder.github.ItemListenerImpl maybeApply
      WARNING: Failed to apply GitHub Org Folder theme to crash-test-dummies
      org.jenkinsci.plugins.github_branch_source.RateLimitExceededException: GitHub API rate limit exceeded
      	at org.jenkinsci.plugins.github_branch_source.Connector$1.onError(Connector.java:177)
      	at org.kohsuke.github.Requester.handleApiError(Requester.java:544)
      	at org.kohsuke.github.Requester._to(Requester.java:264)
      	at org.kohsuke.github.Requester.to(Requester.java:205)
      	at org.kohsuke.github.GitHub.getUser(GitHub.java:293)
      	at org.jenkinsci.plugins.orgfolder.github.MainLogic.applyOrg(MainLogic.java:62)
      	at org.jenkinsci.plugins.orgfolder.github.ItemListenerImpl.maybeApply(ItemListenerImpl.java:41)
      	at org.jenkinsci.plugins.orgfolder.github.ItemListenerImpl.onCreated(ItemListenerImpl.java:34)
      	at hudson.model.listeners.ItemListener$2.apply(ItemListener.java:186)
      	at hudson.model.listeners.ItemListener$2.apply(ItemListener.java:184)
      	at hudson.model.listeners.ItemListener.forAll(ItemListener.java:167)
      	at hudson.model.listeners.ItemListener.fireOnCreated(ItemListener.java:184)
      	at hudson.model.ItemGroupMixIn.createProject(ItemGroupMixIn.java:334)
      	at hudson.model.ItemGroupMixIn.createTopLevelItem(ItemGroupMixIn.java:203)
      	at jenkins.model.Jenkins.doCreateItem(Jenkins.java:3669)
      

      Once a credential is specified and the item is saved, the organization scan step will use authenticated requests as expected:

      Started
      Consulting GitHub Organization
      Connecting to https://api.github.com using crash-test-dummy/****** (crash-test-dummy / ci-dev.inclusivedesign.ca)
      Looking up repositories of organization crash-test-dummies
      
      Proposing gpii-nexus
      Connecting to https://api.github.com using crash-test-dummy/****** (crash-test-dummy)
      Looking up crash-test-dummies/gpii-nexus
      
        Getting remote pull requests...
      
          Checking pull request #1
          Job name: PR-1
            ‘Jenkinsfile’ exists in this pull request
          Met criteria
      
        1 pull requests were processed
      
        Getting remote branches...
      
          Checking branch master
            ‘Jenkinsfile’ does not exist in this branch
          Does not meet criteria
      
        0 branches were processed
      
      Done examining crash-test-dummies/gpii-nexus
      
      Finished: SUCCESS
      

      This issue is happening even though a GitHub user was added globally with the proper credentials (verified to be working: "Credentials verified for user crash-test-dummy, rate limit: 4934").

            kohsuke Kohsuke Kawaguchi
            gtirloni Giovanni Tirloni
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: