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

GitHub Rate Limits are compared using the Jenkins master time not the http response's Date

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None

      Using github-branch-source plugin 2.2.3. For full environment version information see the Environment meta detail at the top of this issue.

      Description of problem

      My multibranch pipeline job currently hangs for 10+ hours before it will apparently allow a build. The scan log output says it's due to me being over budget with my quota. I would like my job to run right away since there's available quota in the rate limit of my token.

      My actual available rate limit

      The limit reset is 17 minutes from now at the time of this writing.

      $ date -d @1506504539
      Wed Sep 27 02:28:59 PDT 2017
      
      $ curl -H "Authorization: token $GH_TOKEN" https://api.github.com/rate_limit
      {
        "resources": {
          "core": {
            "limit": 5000,
            "remaining": 4997,
            "reset": 1506504539
          },
          "search": {
            "limit": 30,
            "remaining": 30,
            "reset": 1506502499
          },
          "graphql": {
            "limit": 5000,
            "remaining": 5000,
            "reset": 1506506039
          }
        },
        "rate": {
          "limit": 5000,
          "remaining": 4997,
          "reset": 1506504539
        }
      }
      

      Scan log error

      My scan log from a multibranch pipeline job including the error:

      Started by user admin
      [Tue Sep 26 22:44:05 UTC 2017] Starting branch indexing...
      22:44:05 Connecting to https://api.github.com using samrocketman/****** (GitHub user and personal access token used by multibranch pipeline jobs for the GitHub API)
      22:44:06 GitHub API Usage: Current quota has 4997 remaining (35557 over budget). Next quota of 5000 in 10 hr. Sleeping for 9 hr 29 min.
      22:47:06 GitHub API Usage: Still sleeping, now only 9 hr 26 min remaining.
      22:50:06 GitHub API Usage: Still sleeping, now only 9 hr 23 min remaining.
      22:53:06 GitHub API Usage: Still sleeping, now only 9 hr 20 min remaining.
      22:56:06 GitHub API Usage: Still sleeping, now only 9 hr 17 min remaining.
      22:59:06 GitHub API Usage: Still sleeping, now only 9 hr 14 min remaining.
      23:02:06 GitHub API Usage: Still sleeping, now only 9 hr 11 min remaining.
      23:05:06 GitHub API Usage: Still sleeping, now only 9 hr 8 min remaining.
      23:08:06 GitHub API Usage: Still sleeping, now only 9 hr 5 min remaining.
      23:11:06 GitHub API Usage: Still sleeping, now only 9 hr 2 min remaining.
      

      See also

            bitwiseman Liam Newman
            sag47 Sam Gleske
            Votes:
            3 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: