Hitting secondary rate limit on issues creation. #50326
Replies: 2 comments
-
|
The error message you received indicates that you have exceeded a secondary rate limit for content creation on GitHub's REST API. This means that you have hit a limit on the number of requests you can make within a certain time period. Unfortunately, there is no way to bypass this limit or increase it. The only solution is to wait until the rate limit resets, and then try your request again. To find out what the actual rate limit is, you can check the response headers for the X-RateLimit-Limit header. In your case, the limit is set to 5000 requests per hour. One possible reason for hitting the rate limit could be that you are making too many requests too quickly. As you mentioned, you are creating 10 issues at a time asynchronously and waiting for 90 seconds. However, this may still be too frequent if you are creating a large number of issues. You may want to increase the wait time between batches to avoid hitting the rate limit. It's also worth noting that GitHub has different rate limits for different types of requests and endpoints, so it's possible that you may be hitting a different rate limit for a specific endpoint. You can check the documentation for the specific endpoint you are using to see what the rate limits are. |
Beta Was this translation helpful? Give feedback.
-
|
As @Mohamed-SayedAlAhl said, you're facing a secondary rate limit here (x-ratelimit-reset is set whilst x-ratelimit-remaining > 0). Anyway, if you're running a Go application, you're welcome to use https://github.com/gofri/go-github-ratelimit that assists in handling these secondary rate limits, following GitHub's guidelines for being a "good API citizen". |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Bug
Body
I'm trying to import my company products from Gitlab to Github.
I found a way to import large amounts of repo issues by parsing exported from Gitlab .csv file.
I'm getting:
It happens at random after around 100-150 issues getting imported with 201 status.
In response headers X-RateLimit-Limit is not fully used at all, and there is not time set in Retry-After:
'Server': 'GitHub.com', 'Date': 'Fri, 17 Mar 2023 13:35:22 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Transfer-Encoding': 'chunked', 'X-OAuth-Scopes': 'admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages', 'X-Accepted-OAuth-Scopes': '', 'github-authentication-token-expiration': '2023-04-12 ****', 'X-GitHub-Media-Type': 'github.v3; format=json', 'x-github-api-version-selected': '2022-11-28', 'X-RateLimit-Limit': '5000', 'X-RateLimit-Remaining': '4820', 'X-RateLimit-Reset': '1679061963', 'X-RateLimit-Used': '180', 'X-RateLimit-Resource': 'core', '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', 'Access-Control-Allow-Origin': '*', 'Strict-Transport-Security': 'max-age=31536000; includeSubdomains; preload', 'X-Frame-Options': 'deny', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '0', 'Referrer-Policy': 'origin-when-cross-origin, strict-origin-when-cross-origin', 'Content-Security-Policy': "default-src 'none'", 'Vary': 'Accept-Encoding, Accept, X-Requested-With', 'Content-Encoding': 'gzip', 'X-GitHub-Request-Id': '****'I'm creating 10 issues at a time asynchronously then waiting for 90 seconds. Can provide pyton code if needed.
I've found a discussion on this topic, but there is no answer how to bypass this limit or just how to find out what is the actual limit is: https://github.com/orgs/community/discussions/32120
Beta Was this translation helpful? Give feedback.
All reactions