-
Notifications
You must be signed in to change notification settings - Fork 565
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
Not using "token" on github server #229
Comments
When people are hitting the rate limit, is it from a single self-hosted runner being reused for multiple jobs that call The action will look for a previously installed version of Python before fetching the manifest file (line 50 of the same file). Given that the rate limit is 60/hr for unauthenticated requests, that seems like a lot of different versions for one runner. If it is one runner, I think the right fix is just to cache the manifest file (which changes relatively infrequently) with an expiry of 1 hour rather than fetching it every time. |
In my case, I am running from multiple self-hosted runners. However they are behind a NAT in AWS. This is resulting in their source IP address being the same. |
Thanks, makes sense. Caching the manifest file won't work then. GitHub Connect is the preferred mechanism for linking GHES to github.com. However, it seems clear to me that we won't have time to do that any time soon. So I think the best approach is just to remove the nulling-out of the |
Reopening; unfortunately we found a flaw in the approach #437 |
Thanks for keeping me updated. Do you think we could add a second input parameter that can be used for GHES to pass in the |
That's one way to do it, but having separate It's clear that there's a feature gap in the cc @thboop |
Ok, this should be fixed now in |
@brcrista what do you mean by fixed? Our organisation is running into the same problem - multiple runners behind the same IP requesting this and getting the rate limit error. How do I fix this? |
@kasuteru can you confirm that you're:
|
@brcrista I am using action v4, which is the newest one and should include the fix I think. But there is a lot of information missing regarding what exactly is needed by this action:
My code is now as follows:
Thanks! |
Update: I realized I can turn on verbosity by setting a secret. Will evaluate further. |
@kasuteru (The PR with the fix was merged on Aug 30, but the latest release, So, you'll have to pull the latest
None; you're just making the call as an authenticated user instead of an anonymous user.
There's a rate limit API. This YAML snippet has an example.
You should see some logging if it has to make the request. |
Thank you for the reply. I didn't realize v4 didn't have it yet - that explains it. With your help, I was able to verify that caching indeed usually works, but not always, and when it doesn't work, it almost always runs into the rate limit. I suspect this is because our company has a lot of runners hidden behind the same IP. When trying to use your version, the following error came up - looks like one needs to always specify the full version. After specifying the full hash, I was able to confirm that it now works! Thank you! I will write a separate post-mortem post for anyone stumbling upon this at a later time. |
Thanks! I've updated my previous comments with the full SHA.
If you'd like to add anything that tripped you up to our docs for GHES, that would be very helpful! |
Okay, I'll write a PR with a bit more information on how to tackle this. |
Describe the bug
Hi I am using actions/setup-python on a private github server. When I run
curl https://api.github.com/rate_limit
in the self-hosted runner I have 60 remaining resources. When I run the curl command again afteruses: actions/setup-python
I see that the resource counter goes down to 58. Since I am running this action a lot I eventually exceed my api call limit.I tried using the key
token
under the with section with a token I created from github cloud but that did not work. I saw that when we are running on github server we are setting theAUTH
variable to undefined. Link to code.I know we are using
${{ github.token }}
by default from theactions.yml
file. So I believe the check for github server was added so that tokens from the private github server don't get sent to github cloud. Could we add a second input for the token so that people running on private github servers don't run into the api call limit error? Or if we detect that we are running on a private github server, could we try to useactions/python-versions
on the github server instead?Which version of the action are you using?
v1
v2
v2.0.1
ormaster
)Environment
If applicable, please specify if you're using a container
Python Versions
To Reproduce
Steps to reproduce the behavior:
actions/setup-python@v2
on github server a lotError: API rate limit exceeded for <IP address>. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)
github actions yaml file:
The text was updated successfully, but these errors were encountered: