-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Add a suggestive log for GitHub API rate-limiting issue during install #99691
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
base: main
Are you sure you want to change the base?
Conversation
|
Hello @3V3RYONE, and thank you very much for your first pull request to the Zephyr project! |
|
Please fix the compliance issue (git commit subject too long) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--personal-access-token is long and inconvenient, could you test .netrc and add it as a recommendation in the --help if it works?
https://docs.python-requests.org/en/latest/user/authentication/#netrc-authentication
If someone has a valid access token, why would they store it in the wrong place and use it only with west sdk --personal-access-token ...? Weird. There are many other ways to hit rate limits.
It's an argument for the |
And? I miss your point sorry. |
Why shouldn't we refer to an option that is available for the same command that the user just tried to execute? |
|
I didn't say |
`west sdk install` may fail with a GitHub API rate-limit (HTTP 403) error. This typically occurs when the command is run multiple times after previous failures, which is common for new users setting up the project. Currently, the thrown exception only links to a generic GitHub rate-limit documentation page, which may be confusing to users. Users can bypass the rate limit by authenticating with GitHub using a Personal Access Token. The install script supports this via the `--personal-access-token` argument. Therefore, detect rate-limit related failures and print a helpful message suggesting the use of this argument. Signed-off-by: Beleswar Prasad Padhi <[email protected]>
ad6ce7c to
a68cf35
Compare
|
I did some testing and I have a strong suspicion your It took me a while but I found a couple ways to test much faster and more reliable than downloading the SDK repeatedly. I spent time testing this because the .netrc really matters: it's superior to Please try this: python3 -c 'import requests; print(requests.get("https://api.github.com/user/issues").content)'
# Bad .netrc OR bad token shows this:
b'{\r\n "message": "Requires authentication",\r\n "documentation_url": "https://docs.github.com/rest",\r\n "status": "401"\r\n}'
# Good .netrc AND good token returns a list (empty or not)
b'[ ... ]'You can also compare these two commands: When using As long as the .netrc file is valid, you will see the "authorization" fields even when the token is wrong. The .netrc file should look like this: Don't forget the indentation. Obviously, make sure the .netrc file is readable only by you. BTW I think |



west sdk installmay fail with a GitHub API rate-limit (HTTP 403) error. This typically occurs when the command is run multiple times after previous failures, which is common for new users setting up the project. Currently, the thrown exception only links to a generic GitHub rate-limit documentation page, which may be confusing to users.Users can bypass the rate limit by authenticating with GitHub using a Personal Access Token. The install script supports this via the
--personal-access-tokenargument. Therefore, detect rate-limit related failures and print a helpful message suggesting the use of this argument.Fixes #93693