LoginSignup
2
2

More than 5 years have passed since last update.

Cygwinのknife solo cookがconnection closed by remote hostでコケル件

Posted at

Windows版のChef-DKが出れば意味がなくなると思うのですが。

cygwinでknife soloを実行したところ以下のようなエラーが出ました。

$ knife solo cook sample
Running Chef on sample...
Checking Chef version...
Uploading the kitchen...
ERROR: Net::SSH::Disconnect: connection closed by remote host

こちらで報告されている事象のようです。
https://github.com/matschaffer/knife-solo/issues/332

knife-soloが0.4.1では以下のようなワークアラウンドが紹介されていました。
https://github.com/keeruline/knife-solo/commit/d57894b671fa25a791d8302e2ada7b6be2d7d72f

0.4.2では該当コードが編集されておりましたが、不具合はまだ直っていないようです。
よくわからないのですが、以下のようにコメントアウトしたら動きました。

$ vi /usr/lib/ruby/gems/1.9.1/gems/knife-solo-0.4.2/lib/knife-solo/ssh_connection.rb
solo/ssh_connection.rb
    def session(&block)
+#      @session ||= begin
-      @session ||= begin
        if connection_options[:gateway]
          co = connection_options
          gw_user,gw =  co.delete(:gateway).split '@'
          Net::SSH::Gateway.new(gw, gw_user).ssh(host, user, co, &block)
        else
          Net::SSH.start(host, user, connection_options, &block)
        end
+#      end
-        end
    end
2
2
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
2
2