GeezerVison is showing github.com — `gh auth login` fails with an error: "Too many requests have been made in the same timeframe. (slow_down)" · Issue #9370 · cli/cli
gh auth login fails with an error: "Too many requests have been made in the same timeframe. (slow_down)" #9370
Labels bugSomething isn't workingcoreThis issue is not accepting PRs from outside contributorsgh-authrelating to the gh auth commandpriority-3Affects a small number of users or is largely cosmetic DescriptionDescribe the bug
When I try to log in with the GitHub CLI, I get a one-time code and an error message and fail.
Please open this URL to continue in your web browser: https://github.com/login/device
Authentication in web browser failed: Too many requests in the same time frame. (slow_down)
It looks like GitHub is denying access because the CLI is calling the API (probably for polling) too many times.
I didn't try to log in that much, but I got the error.
gh version: 2.53.0 (2024-07-17)
Steps to reproduce the behavior
- Type this 'gh auth login'
- Wait about 10 seconds
Expected vs actual behavior
Success to login
Logs
Paste the activity from your command line. Redact if needed.
Reacted by Kristina Gusarova , livneros-greeneye, Peder Schmedling, Will Slattum, tom, Anna Filina, christine-kit, Mike Parker, Mateusz Bałasz, rgbpx and 15 more Activitywilliammartin commented on Jul 26, 2024 That's surprising, I think this should only happen if the CLI isn't honouring the retry interval.
Does this occur every time you try to log in? If you see this again can you run with GH_DEBUG=api and check the frequency of the requests to the /oauth/access_token path. It should periodically (every 5 seconds) poll this endpoint when waiting for you to fill in the device code. kyoh86 commented on Aug 3, 2024 I checked it out with GH_DEBUG=api.
It looks that periodically poll (every 5seconds), but I got "slow_down" error.
I didn't have a way to copy the log from terminal... Reacted by Kristina Gusarova , Shane Loretz and Chindriș Mihai - Alexandru Booss13 commented on Sep 2, 2024 vikman90 commented on Sep 23, 2024 Hi,
I'm having the same problem. It fails consistently while I manually open the browser and login there.
- Version: gh version 2.57.0 (2024-09-16)
- Host: Bash @ Ubuntu 24.04 @ WSL2
Steps to reproduce
- Run
gh:
GH_DEBUG=api gh auth login -s project
- Open https://github.com/login/device on the browser.
- Follow instructions in the browser.
Logs
Output
? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations on this host? HTTPS
[git config credential.https://github.com.helper]
[git config credential.helper]
? Authenticate Git with your GitHub credentials? Yes
? How would you like to authenticate GitHub CLI? Login with a web browser
* Request at 2024-09-23 10:52:06.335502768 +0200 CEST m=+16.057057598
* Request to https://github.com/login/device/code
> POST /login/device/code HTTP/1.1
> Host: github.com
> Content-Length: 74
> Content-Type: application/x-www-form-urlencoded
client_id=178c6fc778ccc68e1d6a&scope=repo+read%3Aorg+gist+project+workflow
< HTTP/2.0 200 OK
< Cache-Control: max-age=0, private, must-revalidate
< Content-Security-Policy: default-src 'none'; base-uri 'self'; child-src github.com/assets-cdn/worker/ github.com/webpack/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.com/assets-cdn/worker/ github.com/webpack/ github.com/assets/ gist.github.com/assets-cdn/worker/
< Content-Type: application/x-www-form-urlencoded; charset=utf-8
< Date: Mon, 23 Sep 2024 08:52:06 GMT
< Etag: W/"07493827e9f9124bc12d8da73a4d2d10"
< Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
< Server: GitHub.com
< Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
< Vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame
< Vary: Accept-Encoding, Accept, X-Requested-With
< X-Content-Type-Options: nosniff
< X-Frame-Options: deny
< X-Github-Request-Id: D4C4:2AC3CD:22E06EB:23BE19B:66F12C36
< X-Xss-Protection: 0
device_code=38d7b6f3de227d2e970df25e6448bc8b8373a1c0&expires_in=899&interval=5&user_code=A521-E4FC&verification_uri=https%3A%2F%2Fgithub.com%2Flogin%2Fdevice
* Request took 509.669738ms
! First copy your one-time code: A521-E4FC
Press Enter to open github.com in your browser...
! Failed opening a web browser at https://github.com/login/device
exec: "xdg-open,x-www-browser,www-browser,wslview": executable file not found in $PATH
Please try entering the URL in your browser manually
* Request at 2024-09-23 10:52:18.866945773 +0200 CEST m=+28.588500768
* Request to https://github.com/login/oauth/access_token
> POST /login/oauth/access_token HTTP/1.1
> Host: github.com
> Content-Length: 149
> Content-Type: application/x-www-form-urlencoded
client_id=178c6fc778ccc68e1d6a&device_code=38d7b6f3de227d2e970df25e6448bc8b8373a1c0&grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code
< HTTP/2.0 200 OK
< Cache-Control: max-age=0, private, must-revalidate
< Content-Security-Policy: default-src 'none'; base-uri 'self'; child-src github.com/assets-cdn/worker/ github.com/webpack/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.com/assets-cdn/worker/ github.com/webpack/ github.com/assets/ gist.github.com/assets-cdn/worker/
< Content-Type: application/x-www-form-urlencoded; charset=utf-8
< Date: Mon, 23 Sep 2024 08:52:17 GMT
< Etag: W/"ddc6411a4610fbc6848540d812a15c5a"
< Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
< Server: GitHub.com
< Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
< Vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame
< Vary: Accept-Encoding, Accept, X-Requested-With
< X-Content-Type-Options: nosniff
< X-Frame-Options: deny
< X-Github-Request-Id: D4C4:2AC3CD:22E4BDF:23C274A:66F12C36
< X-Xss-Protection: 0
error=authorization_pending&error_description=The+authorization+request+is+still+pending.&error_uri=https%3A%2F%2Fdocs.github.com%2Fdevelopers%2Fapps%2Fauthorizing-oauth-apps%23error-codes-for-the-device-flow
* Request took 166.921278ms
* Request at 2024-09-23 10:52:24.046001173 +0200 CEST m=+33.767556055
* Request to https://github.com/login/oauth/access_token
> POST /login/oauth/access_token HTTP/1.1
> Host: github.com
> Content-Length: 149
> Content-Type: application/x-www-form-urlencoded
client_id=178c6fc778ccc68e1d6a&device_code=38d7b6f3de227d2e970df25e6448bc8b8373a1c0&grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Adevice_code
< HTTP/2.0 200 OK
< Cache-Control: max-age=0, private, must-revalidate
< Content-Security-Policy: default-src 'none'; base-uri 'self'; child-src github.com/assets-cdn/worker/ github.com/webpack/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.com/assets-cdn/worker/ github.com/webpack/ github.com/assets/ gist.github.com/assets-cdn/worker/
< Content-Type: application/x-www-form-urlencoded; charset=utf-8
< Date: Mon, 23 Sep 2024 08:52:22 GMT
< Etag: W/"6640a8dc722945ef206a671f9ddc8605"
< Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
< Server: GitHub.com
< Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
< Vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame
< Vary: Accept-Encoding, Accept, X-Requested-With
< X-Content-Type-Options: nosniff
< X-Frame-Options: deny
< X-Github-Request-Id: D4C4:2AC3CD:22E6717:23C4300:66F12C41
< X-Xss-Protection: 0
error=slow_down&error_description=Too+many+requests+have+been+made+in+the+same+timeframe.&error_uri=https%3A%2F%2Fdocs.github.com&interval=10
* Request took 168.095916ms
failed to authenticate via web browser: Too many requests have been made in the same timeframe. (slow_down)
Best regards. williammartin commented on Sep 23, 2024 Thanks! Interestingly, we can see that the requests are more than 5 seconds apart:
* Request at 2024-09-23 10:52:18.866945773 +0200 CEST m=+28.588500768
...
* Request at 2024-09-23 10:52:24.046001173 +0200 CEST m=+33.767556055
But the responses show something different:
< Date: Mon, 23 Sep 2024 08:52:17 GMT
...
< Date: Mon, 23 Sep 2024 08:52:22 GMT
Theoretically, if these were say 08:52:17.9 and 08:52:22.0 then they would only be 4.1 seconds apart and would hit the rate limit.
I wonder if this is happening because the servers you happen to hit have some kind of clock skew. Happening consistently seems a bit suspicious though. Does it happen absolutely every time?
I'll go poke around the platform code and see if anything obvious jumps out. williammartin commented on Sep 23, 2024 A quick investigation leads me to believe that clock skew would not be an issue. The API servers pass off the rate limiting to another component that should be consistent. Will keep thinking about it though 🤔 williammartin commented on Sep 23, 2024 We could parse this error:
error=slow_down&error_description=Too+many+requests+have+been+made+in+the+same+timeframe.&error_uri=https%3A%2F%2Fdocs.github.com&interval=10
And implement an actual slow down here but since we're missing some key context about why the API server believes this request came too quickly, I'm not sure how much it would help.
I think I'll probably bring this up with the API team.
There's an old discussion here with some ideas #6884. Though I can't really see how they'd relate to the debug output you have there does seem to some common theme with WSL. I'd be pretty interested to know if any of them work (particularly, setting your clock). I can't fathom why the clock being wrong would result even in this behaviour regardless of timestamps in logs so clearly I'm missing something. BagToad commented on Mar 4, 2026 To all the folks in this thread, please leave us a comment if this is resolved for you in latest gh versions. Would be great to close this out or continue the investigation. PatchFact commented on Mar 5, 2026 Still having this issue, leaving a comment for tracking. I followed the steps on this site and got the auth to work: https://www.freecodecamp.org/news/github-cli-wsl2-guide/. Crucially, not pressing "Enter" when prompted and instead directly going to the device authentication page on GitHub and inputting the code before pressing "Enter" is what actually did the trick. Hopefully this info is useful. Reacted by Mohammad Ayoub and kking-autointel Reacted by Amir Hasanbasic williammartin commented on Mar 10, 2026 PatchFact commented on Mar 10, 2026 Sorry, forgot to mention @williammartin . I am on:
gh version 2.87.3 (2026-02-23)
https://github.com/cli/cli/releases/tag/v2.87.3
I am on MacOS Sequoia 15.3.1 and installed with brew. williammartin commented on Mar 10, 2026 Ok well, if you get a chance it would be useful to have the GH_DEBUG=api gh auth login output (make sure to redact any auth codes in the response bodies before sharing) to see what's going on. You're not on WSL so it sounds like something different. patrickdemafelis88-web commented on Mar 10, 2026 babakks commented on Mar 19, 2026 I'm closing this issue, as the problem seems to be resolved.
Users who are still experiencing this please submit a new issue (and please link it to this one).
MetadataMetadatabugSomething isn't workingcoreThis issue is not accepting PRs from outside contributorsgh-authrelating to the gh auth commandpriority-3Affects a small number of users or is largely cosmetic DevelopmentNo branches or pull requestsIssue actions
|