Closed mtharpe closed 4 years ago
I am able to see that with verbose mode turned on, knife returns a list of hosts. Once that is complete if the list returns hosts that are up first it will work until it hits a node that is not available and the will stop based on the fact that it is not able to connect to that node. This behavior is very different from SSH as if the node is not available with SSH it will continue which is the expected result for WINRM I would think.
@mtharpe I have added some comments on #445 could you please look at those I think this is the similar issue and let us know if that works for you.
@Vasu1105 I will test and verify. Thank you for your response.
@Vasu1105 that would appear to work around the issue, but I would not consider that a final solution as that would be drastically different from a feature and use parity with SSH.
Thank you for your help on this!
Closing this issue as its been resolved by PR #484
When running knife winrm "name:somequery" 'some command' and there is a return from the chef server that has a server that is not available the whole command fails.
/opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2.4/lib/httpclient/session.rb:604:in'
initialize': execution expired (HTTPClient::ConnectTimeoutError) from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2.4/lib/httpclient/session.rb:604:in
new' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2.4/lib/httpclient/session.rb:604:increate_socket' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2.4/lib/httpclient/session.rb:749:in
block in connect' from /opt/chefdk/embedded/lib/ruby/2.3.0/timeout.rb:101:intimeout' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2.4/lib/httpclient/session.rb:742:in
connect' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2.4/lib/httpclient/session.rb:504:inquery' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2.4/lib/httpclient/session.rb:174:in
query' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2.4/lib/httpclient.rb:1240:indo_get_block' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2.4/lib/httpclient.rb:1017:in
block in do_request' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2.4/lib/httpclient.rb:1131:inprotect_keep_alive_disconnected' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2.4/lib/httpclient.rb:1012:in
do_request' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2.4/lib/httpclient.rb:854:inrequest' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/httpclient-2.8.2.4/lib/httpclient.rb:763:in
post' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/winrm-2.1.0/lib/winrm/http/transport.rb:220:ininit_auth' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/winrm-2.1.0/lib/winrm/http/transport.rb:168:in
send_request' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/winrm-2.1.0/lib/winrm/shells/cmd.rb:56:inopen_shell' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/winrm-2.1.0/lib/winrm/shells/base.rb:163:in
block in open' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/winrm-2.1.0/lib/winrm/shells/retryable.rb:37:inretryable' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/winrm-2.1.0/lib/winrm/shells/base.rb:161:in
open' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/winrm-2.1.0/lib/winrm/shells/base.rb:124:inwith_command_shell' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/winrm-2.1.0/lib/winrm/shells/base.rb:80:in
run' from /Users/mtharpe/.chefdk/gem/ruby/2.3.0/gems/knife-windows-1.7.0/lib/chef/knife/winrm_session.rb:69:inblock in relay_command' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/winrm-2.1.0/lib/winrm/connection.rb:43:in
shell' from /Users/mtharpe/.chefdk/gem/ruby/2.3.0/gems/knife-windows-1.7.0/lib/chef/knife/winrm_session.rb:67:inrelay_command' from /Users/mtharpe/.chefdk/gem/ruby/2.3.0/gems/knife-windows-1.7.0/lib/chef/knife/winrm_knife_base.rb:130:in
block in relay_winrm_command' from /Users/mtharpe/.chefdk/gem/ruby/2.3.0/gems/knife-windows-1.7.0/lib/chef/knife/winrm_knife_base.rb:128:ineach' from /Users/mtharpe/.chefdk/gem/ruby/2.3.0/gems/knife-windows-1.7.0/lib/chef/knife/winrm_knife_base.rb:128:in
relay_winrm_command' from /Users/mtharpe/.chefdk/gem/ruby/2.3.0/gems/knife-windows-1.7.0/lib/chef/knife/winrm_knife_base.rb:114:inrun_command' from /Users/mtharpe/.chefdk/gem/ruby/2.3.0/gems/knife-windows-1.7.0/lib/chef/knife/winrm.rb:60:in
execute_remote_command' from /Users/mtharpe/.chefdk/gem/ruby/2.3.0/gems/knife-windows-1.7.0/lib/chef/knife/winrm.rb:52:inrun' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/knife.rb:429:in
block in run_with_pretty_exceptions' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/local_mode.rb:44:inwith_server_connectivity' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/knife.rb:428:in
run_with_pretty_exceptions' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/knife.rb:219:inrun' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/lib/chef/application/knife.rb:156:in
run' from /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-12.15.19/bin/knife:25:in<top (required)>' from /usr/local/bin/knife:57:in
load' from /usr/local/bin/knife:57:in `