James Taylor
James Taylor

Reputation: 6258

SSH::ConnectionTimeout using knife solo

I am trying to test a Chef cookbook using knife solo and vagrant.

Using the information provided by vagrant ssh-config, I can connect to my vagrant host as follows:

ssh -p 3774 -i /path/to/.vagrant/machines/default/virtualbox/private_key vagrant@localhost

I am calling knife solo with:

knife solo prepare -p 3774 -i /path/to/.vagrant/machines/default/virtualbox/private_key vagrant@localhost -VV

Which raises the exception:

ERROR: Net::SSH::ConnectionTimeout: Net::SSH::ConnectionTimeout

Stack trace:

Bootstrapping Chef...
/usr/local/lib/ruby/gems/2.4.0/gems/net-ssh-3.2.0/lib/net/ssh/transport/session.rb:90:in `rescue in initialize': Net::SSH::ConnectionTimeout (Net::SSH::ConnectionTimeout)
    from /usr/local/lib/ruby/gems/2.4.0/gems/net-ssh-3.2.0/lib/net/ssh/transport/session.rb:57:in `initialize'
    from /usr/local/lib/ruby/gems/2.4.0/gems/net-ssh-3.2.0/lib/net/ssh.rb:232:in `new'
    from /usr/local/lib/ruby/gems/2.4.0/gems/net-ssh-3.2.0/lib/net/ssh.rb:232:in `start'
    from /usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/knife-solo/ssh_connection.rb:42:in `session'
    from /usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/knife-solo/ssh_command.rb:153:in `try_connection'
    from /usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/knife-solo/ssh_command.rb:194:in `detect_authentication_method'
    from /usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/knife-solo/ssh_command.rb:290:in `run_command'
    from /usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/chef/knife/solo_prepare.rb:71:in `operating_system'
    from /usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/chef/knife/solo_prepare.rb:67:in `bootstrap'
    from /usr/local/lib/ruby/gems/2.4.0/gems/knife-solo-0.6.0/lib/chef/knife/solo_prepare.rb:57:in `run'
    from /usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/knife.rb:442:in `block in run_with_pretty_exceptions'
    from /usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/local_mode.rb:44:in `with_server_connectivity'
    from /usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/knife.rb:441:in `run_with_pretty_exceptions'
    from /usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/knife.rb:219:in `run'
    from /usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/lib/chef/application/knife.rb:156:in `run'
    from /usr/local/lib/ruby/gems/2.4.0/gems/chef-13.2.20/bin/knife:25:in `<top (required)>'
    from /usr/local/bin/knife:22:in `load'
    from /usr/local/bin/knife:22:in `<main>'

Not sure what could possibly be causing knife solo to fail. I have also tried specifying the -P vagrant password instead of the identity file, to the same effect.

How can I connect knife solo to a local host?

Thanks for you help!

Upvotes: 1

Views: 360

Answers (0)

Related Questions