LoginSignup
12
12

More than 5 years have passed since last update.

knife-solo cookでrsync errorが出た時の対応

Last updated at Posted at 2013-05-30

Jenkinsからknife-soloを使ってEC2に環境構築をしている際に、以下のエラーが発生した。
ただし、別の環境から実施した際は同現象は発生しなかったので、特定のバージョンに依存した現象かも。
なお、cookする前に、knife solo prepareでEC2側にchefをインストールしている。

環境

  • OS : CentOS 6.3
  • knife-solo : gem installした0.2.0
  • chef : 11.4.4
  • rsync : 3.0.6

EC2

  • OS : AmazonLinux 64bit
  • type : t1.micro

エラー内容

+ bundle exec knife solo cook ec2-XXX.amazonaws.com
Checking Chef version...
Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]
ERROR: RuntimeError: Failed to launch command rsync -rl  --rsh="ssh ec2-user@ec2-XXX.amazonaws.com" --delete --exclude revision-deploys --exclude tmp --exclude '.*' --exclude *~ --exclude *.sw[a-z] --exclude */.svn/*  ./ :/tmp/chef-solo

回避策

原因不明で色々悩んでいたところ、sshした際に出る公開鍵登録の確認にyesで答えて、出なくしてあげると現象が出なくなる事を確認した。

Are you sure you want to continue connecting (yes/no)? yes

knife-solo実行側の~/.ssh/configに

Host *.amazonaws.com
  StrictHostKeyChecking no

と書いてあげる事で、yes/noは聞かれなくなり、エラーが解消された。

12
12
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
12
12