ようへいの日々精進XP

よかろうもん

CircleCI で checkout がコケる場合 (1)

tl;dr

勉強用の Github リポジトリと連携していた CircleCI プロジェクトで, 以下のようなエラーが出てソースコードのチェックアウトが失敗していた.

...
Using SSH Config Dir /home/circleci/.ssh
Cloning into '.'...
Warning: Permanently added the RSA host key for IP address 'xxx.xxx.xxx.xxx' to the list of known hosts.

Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

exit status 128

何が起こっていたのか

Deploy Key が未登録だった.

f:id:inokara:20200629234626p:plain

なぜ, 未登録になってしまったのか解らない.

どうしたか

Projects リストから Set up Project をクリック.

f:id:inokara:20200629235137p:plain

Add Manually をクリック.

f:id:inokara:20200629235349p:plain

Start Building をクリック.

f:id:inokara:20200629235539p:plain

この状態で Github リポジトリの Deploy Key を見てみると..., 以下のように CircleCI の SSH キーが登録されていました.

f:id:inokara:20200629235821p:plain

やったー.

Using SSH Config Dir /home/circleci/.ssh
Cloning into '.'...
Warning: Permanently added the RSA host key for IP address 'xxx.xxx.xxx.xxx' to the list of known hosts.

remote: Enumerating objects: 22, done.        
remote: Counting objects: 100% (22/22), done.        
remote: Compressing objects: 100% (13/13), done.        
remote: Total 114 (delta 5), reused 20 (delta 4), pack-reused 92        
Receiving objects: 100% (114/114), 10.84 KiB | 3.61 MiB/s, done.
Resolving deltas: 100% (44/44), done.
HEAD is now at ab35411 test
HEAD is now at ab35411 test

ちゃんとチェックアウトされた.

以上

ほんとにちょっとしたことだけど, また一つ学びを得た.