Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exceeding a secondary rate limit even with 10.0.7 #867

Open
victor-keltio opened this issue Jul 3, 2024 · 4 comments
Open

Exceeding a secondary rate limit even with 10.0.7 #867

victor-keltio opened this issue Jul 3, 2024 · 4 comments

Comments

@victor-keltio
Copy link

Hey there, I saw that a recent release was made to use GraphQL instead of Github's API to avoid hitting the rate limits.
I bumped my @semantic-release/github version to use ^10.0.7 but even with this, I'm hitting the limits:

 AggregateError: 
    HttpError: You have exceeded a secondary rate limit. Please wait a few minutes before you try again. If you reach out to GitHub Support for help, please include the request ID XXX. - https://docs.github.com/free-pro-team@latest/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits
        at file:///home/runner/work/XXX/node_modules/@octokit/request/dist-bundle/index.js:106:21
        at async requestWithGraphqlErrorHandling (file:///home/runner/work/XXX/node_modules/@octokit/plugin-retry/dist-bundle/index.js:36:20)
        at async Job.doExecute (/home/runner/work/XXX/node_modules/bottleneck/light.js:405:18)
    at file:///home/runner/work/XXX/node_modules/semantic-release/lib/plugins/pipeline.js:55:13
    at async pluginsConfigAccumulator.<computed> [as success] (file:///home/runner/work/XXX/node_modules/semantic-release/lib/plugins/index.js:87:11)
    at async run (file:///home/runner/work/XXX/node_modules/semantic-release/index.js:218:3)
    at async Module.default (file:///home/runner/work/XXX/node_modules/semantic-release/index.js:278:22)
    at async default (file:///home/runner/work/XXX/node_modules/semantic-release/cli.js:55:5) {
  errors: [
    RequestError [HttpError]: You have exceeded a secondary rate limit. Please wait a few minutes before you try again. If you reach out to GitHub Support for help, please include the request ID XXX. - https://docs.github.com/free-pro-team@latest/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits
        at file:///home/runner/work/XXX/node_modules/@octokit/request/dist-bundle/index.js:106:21
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async requestWithGraphqlErrorHandling (file:///home/runner/work/XXX/node_modules/@octokit/plugin-retry/dist-bundle/index.js:36:20)
        at async Job.doExecute (/home/runner/work/XXX/node_modules/bottleneck/light.js:405:18) {
      status: 403,
      request: [Object],
      response: [Object],
      pluginName: '@semantic-release/github'
    }
  ]
}

Is there anything I can do to fix this? I've tried releasing a new version after having waited 10min, but I faced the same issue.
Many thanks for your work and your help :)

@gr2m
Copy link
Member

gr2m commented Jul 3, 2024

Hmm it's a bummer that the request and response objects are not logged, I have not seen that before.

"secondary rate limits" can be have many causes, it's what was previously referred to as abuse limit. We won't be able to 100% avoid them, but there are more things we can do to prevent them.

But first thing of business is to make sure we log out the full error object

@victor-keltio
Copy link
Author

Hey, actually I removed part of the error as I thought it wasn't meaningful, but I guess I was wrong heh. The request and response objects are present in the logs, no worries about that.

Here is the full error log with the 2 objects:

[8:18:53 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. If you reach out to GitHub Support for help, please include the request ID XXX. - https://docs.github.com/free-pro-team@latest/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits
    at file:///home/runner/work/XXX/node_modules/@octokit/request/dist-bundle/index.js:106:21
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async requestWithGraphqlErrorHandling (file:///home/runner/work/XXX/node_modules/@octokit/plugin-retry/dist-bundle/index.js:36:20)
    at async Job.doExecute (/home/runner/work/XXX/node_modules/bottleneck/light.js:405:18) {
  status: 403,
  request: {
    method: 'GET',
    url: 'https://api.github.com/search/issues?q=in%3Atitle+repo%3AXXX%2FXXX+type%3Aissue+state%3Aopen+The%20automated%20release%20is%20failing%20%F0%9F%9A%A8',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': '@semantic-release/github v10.0.7 octokit-core.js/6.1.2 Node.js/20.15.0 (linux; x64)',
      authorization: 'token [REDACTED]'
    },
    request: {
      agent: undefined,
      hook: [Function: bound bound register],
      retryCount: 3
    }
  },
  response: {
    url: 'https://api.github.com/search/issues?q=in%3Atitle+repo%3AXXX%2FXXX+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',
      'content-encoding': 'gzip',
      'content-security-policy': "default-src 'none'",
      'content-type': 'application/json; charset=utf-8',
      date: 'Wed, 03 Jul 2024 08:18:53 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-api-version-selected': '2022-11-28',
      'x-github-media-type': 'github.v3; format=json',
      'x-github-request-id': 'XXX',
      'x-ratelimit-limit': '30',
      'x-ratelimit-remaining': '29',
      'x-ratelimit-reset': '1719994793',
      'x-ratelimit-resource': 'search',
      'x-ratelimit-used': '1',
      'x-xss-protection': '0'
    },
    data: {
      documentation_url: 'https://docs.github.com/free-pro-team@latest/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits',
      message: 'You have exceeded a secondary rate limit. Please wait a few minutes before you try again. If you reach out to GitHub Support for help, please include the request ID XXX.'
    }
  },
  pluginName: '@semantic-release/github'
}
AggregateError: 
    HttpError: You have exceeded a secondary rate limit. Please wait a few minutes before you try again. If you reach out to GitHub Support for help, please include the request ID XXX. - https://docs.github.com/free-pro-team@latest/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits
        at file:///home/runner/work/XXX/node_modules/@octokit/request/dist-bundle/index.js:106:21
        at async requestWithGraphqlErrorHandling (file:///home/runner/work/XXX/node_modules/@octokit/plugin-retry/dist-bundle/index.js:36:20)
        at async Job.doExecute (/home/runner/work/XXX/node_modules/bottleneck/light.js:405:18)
    at file:///home/runner/work/XXX/node_modules/semantic-release/lib/plugins/pipeline.js:55:13
    at async pluginsConfigAccumulator.<computed> [as success] (file:///home/runner/work/XXX/node_modules/semantic-release/lib/plugins/index.js:87:11)
    at async run (file:///home/runner/work/XXX/node_modules/semantic-release/index.js:218:3)
    at async Module.default (file:///home/runner/work/XXX/node_modules/semantic-release/index.js:278:22)
    at async default (file:///home/runner/work/XXX/node_modules/semantic-release/cli.js:55:5) {
  errors: [
    RequestError [HttpError]: You have exceeded a secondary rate limit. Please wait a few minutes before you try again. If you reach out to GitHub Support for help, please include the request ID XXX. - https://docs.github.com/free-pro-team@latest/rest/overview/rate-limits-for-the-rest-api#about-secondary-rate-limits
        at file:///home/runner/work/XXX/node_modules/@octokit/request/dist-bundle/index.js:106:21
        at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
        at async requestWithGraphqlErrorHandling (file:///home/runner/work/XXX/node_modules/@octokit/plugin-retry/dist-bundle/index.js:36:20)
        at async Job.doExecute (/home/runner/work/XXX/node_modules/bottleneck/light.js:405:18) {
      status: 403,
      request: [Object],
      response: [Object],
      pluginName: '@semantic-release/github'
    }
  ]
}

@babblebey
Copy link
Member

Great, thanks @victor-keltio

url: 'https://api.github.com/search/issues?q=in%3Atitle+repo%3AXXX%2FXXX+type%3Aissue+state%3Aopen+The%20automated%20release%20is%20failing%20%F0%9F%9A%A8'

But, this does look like it's still making a request to the Github Issue Search Rest API 🤔

What'd you think @gr2m!?

@gr2m
Copy link
Member

gr2m commented Jul 5, 2024

url: 'https://api.github.com/search/issues?q=in%3Atitle+repo%3AXXX%2FXXX+type%3Aissue+state%3Aopen+The%20automated%20release%20is%20failing%20%F0%9F%9A%A8',

This request is sent to check if an open issue created by semantic-release exists. Either to close it if the releases succeeded or to avoid creating duplicated issues if one already exists. But it's only one request, it's interesting that this one got rate limited.

Can you tell me the x-github-request-id value? It's not sensitive, but I can investigate what the problem was in your case (I'm a GitHub employee).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants