-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Travis-CI + Github API limit #1314
Comments
If you rely on VCS repos for your travis test suite, you'd better run install with --no-interaction, that way it'll fallback to a git clone if the api limit is exhausted. For travis pro I guess you could include an oauth token so that it gets a higher limit, but for public travis repos it's kinda tricky to do that. |
I already did that. Didn't know it would fallback on clone. Thank you! |
Thanks! This was really helpful. Wish it was documented somewhere. |
Wait, this doesn't work with latest composer. Back to square 1. Any suggestions? |
@adrianmacneil what do you mean doesn't work? And is "latest composer" after running self-update or using the latest tag? Because the last tag is quite old by now. |
I mean I've worked around the issue now by using Forgive my ignorance.. is there is a reason composer doesn't just use the public github zip URLs, rather than the API URLs which cause rate limit issues on Travis? |
it is |
Right, I adjusted my comment above to avoid confusing more people :) |
Awesome, thanks guys! I just tested with |
It seems Don't worry. I think I'll just go back to |
@adrianmacneil eh sorry what you experienced is another issue. -n helps when the parsing of a custom package repository fails due to the github rate limiting, but for downloads indeed the only ways to fix it right now are using --prefer-source, or providing an oauth API token but that's not really easy to do on travis for an open source project. |
There is a solution of this problem: Encryption keys
I followed the instructions and created encrypted variable GITHUB_TOKEN
Then i created .travis.yml and composer.json and pushed them to repository And here is stable build on travis-ci.org with configured |
It won't work fully. See this quote from their doc:
|
Composer uses the GitHub API to download packages, but the API is rate-limited so repeated builds from the same IP hit the limit. This adds --prefer-source to download from source, which is slower but more reliable. It also adds --no-interaction to avoid hanging in case a similar issue should arise in the future. Reference: composer/composer#1314
When the GitHub API limit is reached the non-interaction mode would fallback to git cloning. See composer/composer#1314
Had this issue as well when using |
http://blog.wyrihaximus.net/2015/09/github-auth-token-on-travis/ documents most of the solution. What we did:
|
@bojanz really nice solution, Thanks for taking time to post it. 👍 |
Hmm... so Github was supposed to have fixed this by removing anonymous rate limits: But I'm still seeing composer installs failing on Travis with errors like this: We never added an OAuth token to composer.json or .travis.yml, so it shouldn't be authenticating. I think this must be due to rate limiting. |
Yeah, I don't think there's a way to avoid rate limiting in Travis, cause it's simply a case of many builds coming from the same IPs. No matter how high the limit is on GitHub, Travis will reach it. We need to keep using the OAuth tokens. |
Actually it seems to be only intermittently failing. I wonder if some of the Travis IPs are still blacklisted from the old rate limit and it just takes a while to clear them or something... |
Travis CI uses a lot of different IPs and it changes them on every build. That's why it cannot provide a list or a range to whitelist in firewalls. I guess GitHub has rate-limited some IP, but the next built uses another one. |
It may not solve all the problems, but I have successfully tested a workaround which consist in caching the |
I recently ran into this problem, grunted and groaned over it for a couple of days, and wanted to post a fix for our specific problem as it might help others. The cause of this for us was that we had "repository" entries in our composer.json file pointing to our github source for some new repositories under development. Even though we had registered these with packagist, we were still seeing the problem. It wasn't until we removed these repository entries from the composer.json file so that packagist could be the pointer to them, did we finally see our travis builds start to work consistently. |
Is there any suggested way to solve the Github API limit problem? Or will my builds just randomly fail?
https://travis-ci.org/Kdyby/Framework/jobs/3142911
Not sure, if this is problem of Composer or Travis-CI.
The text was updated successfully, but these errors were encountered: