API Rate Limit Error

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.

1 Like

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

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.)"

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.

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

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?

1 Like

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

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 (GitHub API request failed: API rate limit exceeded · Issue #545 · Carthage/Carthage · GitHub):

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.

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?

Github access token did the trick for me

1 Like

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

Hi,

I have added the Github Access Token and I still get the API rate message. Here’s the log:

Running Carthage command

Appending GITHUB_ACCESS_TOKEN to process environments

$ carthage "bootstrap" "--platform" "ios" "--cache-builds"

*** Checking out SwiftyUserDefaults at "4.0.0"

*** Checking out CountryCode at "e0b811832de750e31ecbcc7d2eeb57953c9f16df"

*** Checking out TOCropViewController at "2.5.2"

*** Checking out ALCameraViewController at "3.0.2"

*** Cloning SwiftyUserDefaults

*** Cloning CountryCode

*** Cloning TOCropViewController

*** Cloning ALCameraViewController

*** Checking out AlamofireImage at "4.0.0-beta.5"

*** Cloning AlamofireImage

*** Checking out AnimatedTextInput at "988858cea8c15cea3cff4f1679f87dc9ec632ea6"

*** Cloning AnimatedTextInput

*** Checking out Stevia at "4.7.3"

*** Checking out Alamofire at "5.0.0-rc.2"

*** Cloning Stevia

*** Checking out ImageSlideshow at "1.8.0"

*** Cloning Alamofire

*** Cloning ImageSlideshow

*** No cache found for Alamofire, building with all downstream dependencies

*** No cache found for ALCameraViewController, building with all downstream dependencies

*** No cache found for AnimatedTextInput, building with all downstream dependencies

*** No cache found for CountryCode, building with all downstream dependencies

*** No cache found for ImageSlideshow, building with all downstream dependencies

*** No cache found for Stevia, building with all downstream dependencies

*** No cache found for SwiftyUserDefaults, building with all downstream dependencies

*** No cache found for TOCropViewController, building with all downstream dependencies

*** xcodebuild output can be found in /var/folders/6q/wgy6jtp12w5gzgm9lzcglpqw0000gn/T/carthage-xcodebuild.5blaFx.log

*** Downloading Stevia.framework binary at "Xcode 11.2.1 & Swift 5.1.2"

*** Skipped downloading SwiftyUserDefaults.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.)"

*** Skipped installing Stevia.framework binary due to the error:

"Incompatible Swift version - framework was built with 5.1.2 (swiftlang-1100.0.278 clang-1100.0.33.9) and the local version is 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)."

Falling back to building from the source

*** Building scheme "Alamofire iOS" in Alamofire.xcworkspace

Any idea how to fix it?

Thanks

Hi @nyeu,

Can you please share your Cartfile?

Thanks,
Luna