API Rate Limit Error

carthage
#1

Bitrise Build Issue Report template

Description of the issue

API Rate Limit Error
Please describe the issue here

*** Skipped downloading RocketSpaceClientApi-Framework.framework binary due to the error:
“API rate limit exceeded for 208.52.166.156. (But here’s the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)”

Environment:

iOS build using Carthage

Where did the issue happen?
During the Carthage update

If on Bitrise.io: which stack? If not on Bitrise.io: on what operating system? (Plus any other information you can share)
The latest Xcode 8.2, installed on macOS 10.12 (Sierra).

Which build Step causes the issue and which version of the step?
Carthage

Reproducibility

  • Does a “Rebuild” help? (You can trigger a rebuild from the Build’s page, by clicking the “Rebuild” button in the top right corner of a finished build) : YES/NO
  • Does a rebuild without caches help? (You can remove the Cache:Pull and Cache:Push steps temporarily to not to use the cache, or you can delete all the caches on the Settings tab of the app. : YES/NO
  • If you have multiple different build configurations (workflows), does the issue affect all/more than one? : YES/NO
  • If it’s an issue which happens sporadically, what’s the frequency? (e.g. Once a day ; about x% of the builds) :
  • Does upgrading the build Step to the latest version help? : YES/NO
  • When did the issue start? :

Linux/Android stack builds

Can it be reproduced by running the build locally, after doing a new git clone of the repository into the /tmp directory and running the build from there with the Bitrise CLI ( https://www.bitrise.io/cli )? If no, can it be reproduced with Docker (using the same docker images / environment we use on bitrise.io)? Related guide: https://bitrise-io.github.io/devcenter/docker/run-your-build-locally-in-docker/ .

Other stacks

Can it be reproduced by running the build locally with our CLI ( https://www.bitrise.io/cli ), after doing a new git clone of the repository into the /tmp directory and running the build from there with the Bitrise CLI ( https://www.bitrise.io/cli )?

Build log

Please attach the build log (you can download the build log from the build’s page, once the build is finished, using the “Download log” button - floating at the bottom right corner of the log viewer), or if you can’t attach the whole log then send the full log through a private channel (e.g. email - https://www.bitrise.io/contact ), with a link to the related GitHub issue.

0 Likes

#2

Thanks for reporting!

This error is because Carthage uses the GitHub API quite extensively, and so it can hit API rate limits unless you authenticate it (as mentioned in the error - “But here’s the good news: Authenticated requests get a higher rate limit.”)

The solution is simple: select the Carthage step, and set a GitHub Access Token in the Github Personal Access Token input, as described in the input’s description.

2 Likes

#3

I’m not sure if something changed, but something stopped working.
We’re passing the GITHUB_ACCESS_TOKEN. The step logs that it’s using it, but we’re still getting the api limit error

Appending GITHUB_ACCESS_TOKEN to process environments
"API rate limit exceeded for 208.52.166.154. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)"
0 Likes

#4

Hi @yonas,

Can you please copy paste the related build’s bitrise.io URL? It seems like a config issue, that it’s maybe an invalid API key, but without the logs it’s really hard to tell.

0 Likes

#5

@viktorbenei here’s an example build https://www.bitrise.io/build/f93f14fd72956064

0 Likes

#6

Really strange, from the log it seems to be a carthage issue not bitrise, there are framework downloads before & after the single one where the API rate limit issue is printed and none of the others have this warning:

*** Downloading AMScrollingNavbar.framework binary at "Release 4.3.0"
*** Downloading binary-only framework Crashlytics at "https://raw.githubusercontent.com/Building42/Specs/master/Carthage/tvOS/Crashlytics.json"
*** Skipped downloading Cosmos.framework binary due to the error:
	"API rate limit exceeded for 208.52.166.154. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)"
*** Downloading Crashlytics.framework binary at "3.10.1"
*** Downloading binary-only framework Crashlytics at "https://raw.githubusercontent.com/Building42/Specs/master/Carthage/Crashlytics.json"
*** Downloading Crashlytics.framework binary at "3.10.1"
*** Downloading binary-only framework Fabric at "https://raw.githubusercontent.com/Building42/Specs/master/Carthage/Fabric.json"
*** Downloading Fabric.framework binary at "1.7.5"

If the API token env would not be set by the step then all of these should have the same rate limit warning, but only one does.

Do you have any other build you could link where you see the same thing happening @yonas?

0 Likes

#7

Yeah strange. It happens all the time. Here are 2 other examples


0 Likes

#8

Definitely strange as it only seems to happen for that one framework… If it would be a true API rate limit issue it should happen for other ones as well (should be random).

One solution might be (https://github.com/Carthage/Carthage/issues/545#issuecomment-112303794):

If the errors are still an issue after setting up a credential cache, you can add the --no-use-binaries flag, which will disable the only GitHub API calls in use by Carthage.

0 Likes

#9

One more thing, it seems the error might also appear if

  1. the repo is private and no related auth is specified
  2. the repo doesn’t exist anymore or its URL changed

Can you please ensure/double check that the related repo is at the path you specify?

0 Likes

#10

Github access token did the trick for me

1 Like

#11

I found a new problem.
Some repositories have errors in the README.
For example, aws-sdk-ios.

This README says:

Add the following to your Cartfile:
github "aws / aws-sdk-ios"

The correct way of writing is this.

github "aws-amplify / aws-sdk-ios"

Carthage can redirect internally to get the correct value.
However, URLSession does not hold authentication information at redirect time.

We need to be careful.:joy:

1 Like