semantic-release: HttpError: You have exceeded a secondary rate limit.

Current behavior

I got the error when semantic-release interacts with GitHub to write success messages

[6:24:06 AM] [semantic-release] › ✖  Failed step "success" of plugin "@semantic-release/github"
[6:24:06 AM] [semantic-release] › ✖  An error occurred while running semantic-release: RequestError [HttpError]: You have exceeded a secondary rate limit. Please wait a few minutes before you try again.
    at /home/runner/work/serverless-esbuild/serverless-esbuild/node_modules/@octokit/request/dist-node/index.js:86:21
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  status: 403,
  response: {
    url: 'https://api.github.com/search/issues?q=repo%3Afloydspace%2Fserverless-esbuild+type%3Apr+is%3Amerged+8e105a6ff5174d23adb1eb0e42606c63e1224d24',
    status: 403,
    headers: {
      'access-control-allow-origin': '*',
      'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset',
      connection: 'close',
      'content-encoding': 'gzip',
      'content-security-policy': "default-src 'none'",
      'content-type': 'application/json; charset=utf-8',
      date: 'Mon, 25 Oct 2021 06:24:06 GMT',
      'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
      server: 'GitHub.com',
      'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
      'transfer-encoding': 'chunked',
      vary: 'Accept-Encoding, Accept, X-Requested-With',
      'x-content-type-options': 'nosniff',
      'x-frame-options': 'deny',
      'x-github-media-type': 'github.v3; format=json',
      'x-github-request-id': '0402:301C:BA78B:7F32F3:61764D85',
      'x-ratelimit-limit': '30',
      'x-ratelimit-remaining': '29',
      'x-ratelimit-reset': '1635143106',
      'x-ratelimit-resource': 'search',
      'x-ratelimit-used': '1',
      'x-xss-protection': '0'
    },
    data: {
      documentation_url: 'https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits',
      message: 'You have exceeded a secondary rate limit. Please wait a few minutes before you try again.'
    }
  },
  request: {
    method: 'GET',
    url: 'https://api.github.com/search/issues?q=repo%3Afloydspace%2Fserverless-esbuild+type%3Apr+is%3Amerged+8e105a6ff5174d23adb1eb0e42606c63e1224d24',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'octokit-rest.js/18.12.0 octokit-core.js/3.5.1 Node.js/12.22.7 (linux; x64)',
      authorization: 'token [REDACTED]'
    },
    request: { agent: undefined, hook: [Function: bound bound register] }
  },
  pluginName: '@semantic-release/github'
}
AggregateError: 
    HttpError: You have exceeded a secondary rate limit. Please wait a few minutes before you try again.
        at /home/runner/work/serverless-esbuild/serverless-esbuild/node_modules/@octokit/request/dist-node/index.js:86:21
    at /home/runner/work/serverless-esbuild/serverless-esbuild/node_modules/semantic-release/lib/plugins/pipeline.js:54:11
    at async Object.pluginsConf.<computed> [as success] (/home/runner/work/serverless-esbuild/serverless-esbuild/node_modules/semantic-release/lib/plugins/index.js:80:11)
    at async run (/home/runner/work/serverless-esbuild/serverless-esbuild/node_modules/semantic-release/index.js:201:3)
    at async module.exports (/home/runner/work/serverless-esbuild/serverless-esbuild/node_modules/semantic-release/index.js:260:22)
    at async module.exports (/home/runner/work/serverless-esbuild/serverless-esbuild/node_modules/semantic-release/cli.js:55:5)

Expected behavior

The pipeline completes without errors, though I have nothing to suggest how to fix it.

Environment

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 62
  • Comments: 38 (2 by maintainers)

Commits related to this issue

Most upvoted comments

I plan on working on https://github.com/semantic-release/github/pull/487 after Feb 1st, that should address semantic-release’s site. I hope that will address most of the secondary rate limit errors. But I do have the feeling that GitHub also changed the way the secondary limit is triggered. We’ll see how it goes. If the problem remains I’ll try to find out

For those of you who still experience this problem. I solved this in the meantime by disabling the features in the @semantic-release/github plugin that uses the https://api.github.com/search endpoint, which is the one that causes the secondary rate limit exceeds.

Configure @semantic-release/github as follows:

[
  "@semantic-release/github",
  {
    "successComment": false,
    "failTitle": false
  }
]

Any update on this? 👀

The issue was reported in version 17.4.7. I’m using 19.0.3 and the issue is still there.

@beiertu-mms thank you. where should add that config? my actual workflow config is like this: foxhound87/mobx-react-form@master/.github/workflows/ci.yml

@foxhound87 it depends on how you configure it. We use a .releaserc with the following content (I can’t share a link to the file because it’s an internal repo 😃 )

{
  "branches": [
    "master"
  ],
  "plugins": [
    "@semantic-release/commit-analyzer",
    [
      "@semantic-release/github",
      {
        "successComment": false,
        "failTitle": false
      }
    ],
    "@semantic-release/release-notes-generator"
  ]
}

We’ve had this issue twice within our team this morning in different repos

Both times it received the error You have exceeded a secondary rate limit. Please wait a few minutes before you try again when trying to hit the url https://api.github.com/search/issues

Encountering the same problem, I temporarily used a GitHub Action utility called “Retry Step” to automatically retry failed release steps after a few seconds.

...

jobs:
  release:
  ...

    steps:
      ...

      - name: Build package
        run: npm run build

      - name: Release
        uses: nick-fields/retry@v2
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
        with:
          max_attempts: 3
          timeout_seconds: 600
          retry_on: error
          retry_wait_seconds: 300
          command: npx semantic-release

News?

Curious if this is on the roadmap. This is impacting our releases since we use semantic release.

I also get this issue at least once a day now, though I have yet to find a clear pattern to what triggers it. I have noticed that waiting 10 minutes between sending a PR and merging it seems to help but it’s not s cure-all. Also, this issue seemed to be non-existent a year ago and has steadily be getting worse over the past few months. It has even been getting worse in the repos where I have stuck to using the same version of semantic release for the whole year. So I assume that this is not just an issue with semantic release but possibly the result of some GitHub policy changes. Needless to say, a fix for this would undoubtedly give me some hours of my life back.

I still have the issue in semantic-release version 19.0.5

Hmm… me as well. Github? 🦗🦗🦗 Semantic? 🦗🦗🦗

I still have this issue with semantic-release@20.0.2 & @semantic-release/github@8.0.7.

Just started to get it here too…

😕

An error occurred while running semantic-release: RequestError [HttpError]: You have exceeded a secondary rate limit. Please wait a few minutes before you try again.
    at /home/runner/work/buildpack/buildpack/node_modules/@octokit/request/dist-node/index.js:88:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  status: 403,
  response: {
    url: 'https://api.github.com/search/issues?q=in%3Atitle+repo%3Acontainerbase%2Fbuildpack+type%3Aissue+state%3Aopen+The%20automated%20release%20is%20failing%20%F0%9F%9A%A8',
    status: 403,
    headers: {
      'access-control-allow-origin': '*',
      'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset',
      connection: 'close',
      'content-encoding': 'gzip',
      'content-security-policy': "default-src 'none'",
      'content-type': 'application/json; charset=utf-8',
      date: 'Thu, 18 Aug 2022 06:38:52 GMT',
      'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
      server: 'GitHub.com',
      'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
      'transfer-encoding': 'chunked',
      vary: 'Accept-Encoding, Accept, X-Requested-With',
      'x-content-type-options': 'nosniff',
      'x-frame-options': 'deny',
      'x-github-media-type': 'github.v3; format=json',
      'x-github-request-id': '0781:4BC1:3B86C5:A50266:62FDDE7C',
      'x-ratelimit-limit': '30',
      'x-ratelimit-remaining': '29',
      'x-ratelimit-reset': '1660804792',
      'x-ratelimit-resource': 'search',
      'x-ratelimit-used': '1',
      'x-xss-protection': '0'
    },
    data: {
      documentation_url: 'https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits',
      message: 'You have exceeded a secondary rate limit. Please wait a few minutes before you try again.'
    }
  },
  request: {
    method: 'GET',
    url: 'https://api.github.com/search/issues?q=in%3Atitle+repo%3Acontainerbase%2Fbuildpack+type%3Aissue+state%3Aopen+The%20automated%20release%20is%20failing%20%F0%9F%9A%A8',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'octokit-rest.js/19.0.3 octokit-core.js/4.0.4 Node.js/16.16.0 (linux; x64)',
      authorization: 'token [REDACTED]'
    },
    request: { agent: undefined, hook: [Function: bound bound register] }
  },
  pluginName: '@semantic-release/github'
}

https://github.com/containerbase/buildpack/runs/7893136166?check_suite_focus=true

We’re seeing this issue quite often as well. Is there any known work arounds?

I think the throttling is currently broken because GitHub’s response changed its wording a few months ago.

This will be resolved once we resolve https://github.com/semantic-release/github/issues/299. Pull request welcome!

This is a duplicate of #843. I suspect that that issue was not fixed properly. I got this error today too just for a small push.

I am not sure if semantic-release waits 1 s between two calls, or just 720 ms.

You can wait for a couple of minutes and then retry the job. I did it and it helped.