7
5

More than 5 years have passed since last update.

BitriseでCarthageを使うとAPI rate limit exceeded...

Last updated at Posted at 2019-04-09

BitriseでCarthageを使うと、バイナリダウンロードに失敗する場合がある

*** Skipped downloading XXXXX 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.)”

原因は2つある。

github Apiの利用制限

ログの通り、Carthageが内部で叩いているgithub apiの利用制限に引っかかっている場合がある。

解決法

githubのAccessTokenを発行し、Bitriseの環境変数にセットする。

AccessTokenの取得方法はこちら
スコープのチェックボックスは全てOFFで良い。

BitriseではここにAccessTokenをセットする。
Keyは GITHUB_ACCESS_TOKEN
スクリーンショット 2019-04-09 23.49.42.png

以上で解決する場合がほとんど。

Cartfileの記述ミス

Cartfileの記述にミスがあると、AccessTokenを設定してもエラーが解決しない。
例えば、aws-sdk-ios は罠がある。
(注) 現在は修正されています。

Organizationはaws-amplify
Repositoryはaws-sdk-ios であるにも関わらず、
READMEには github "aws/aws-sdk-ios" と記述されている。
参照
正しくは、Cartfileに github "aws-amplify/aws-sdk-ios" と記述しなければならない。

aws-sdk-iosの場合は、github apiでリダイレクトされ正しい結果が返されるのだが...
Carthage内部ではURLSessionを利用している。URLSessionは (Delegateを実装しなければ) 自動的にリダイレクトするのだが、リダイレクト時にAccessTokenがRequestに残っておらず、apiの利用制限に引っかかるという訳だった。

リダイレクトが発生する条件をGitHubに問い合わせました。
* アカウント間でリポジトリを移動したとき
* アカウント名を変更したとき
以上の場合にリダイレクトが発生するそうです。


2019/4/16 追記
aws-sdk-iosのREADMEは 2.9.5 で修正されました。
https://github.com/aws-amplify/aws-sdk-ios/tree/2.9.5

7
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
5