LoginSignup
44
6

More than 5 years have passed since last update.

CircleCIでx509という証明書エラーに遭遇したときの対処

Last updated at Posted at 2017-12-01

エラー状況

CircleCIでのビルド・デプロイの設定をしているところ、
x509: failed to load system roots and no roots provided
という内容のエラーがrestore_cachesave_cacheで発生していました。

エラー内容詳細

適当に文字列は改変しています。

Skipping cache - error checking storage: RequestError: send request failed
caused by: Get https://circle-production-customer-artifacts.s3.amazonaws.com/?list-type=2&prefix=picard%2F59d0000000000global%2Fcaches%2FXXXXXXXX%22222-yhTkxxxxxxxxxxxxxxxxxqrvrm8IW_Hrsxxxxxx%3D: x509: failed to load system roots and no roots provided

どうやら、AWS S3にオレオレ自己証明書を使って暗号化してキャッシュを保存する動作のようです。

原因

CircleCIのビルドプロセスでcacheの暗号化に使うroot証明書を自分で生成しているのですが、そのためのコマンドが入っていない環境を使っていることが原因でした。

今回ビルドに指定していたDockerイメージがalpineをベースにしたもので、最低限のライブラリしか入れていなかったのです。

対処

ca-certificatesパッケージをインストールする。

alpine linuxならば以下のコマンドをDockerfileに追加します。

RUN apk add --no-cache ca-certificates
44
6
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
44
6