diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-01-19 13:07:48 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-01-19 13:07:48 -0800 |
commit | a9242f3b64fca6195e31ff4f5ed1e10e7ba48137 (patch) | |
tree | c1118a432dfce66751e1516f8e8ad5c265949111 /lib/chef | |
parent | 600f83f177370adbd916666190989054d6fae1f0 (diff) | |
download | chef-a9242f3b64fca6195e31ff4f5ed1e10e7ba48137.tar.gz |
adds EOFError message to handlers
i think this still misses the biggest EOFError culprit which is the
node.save at the end, but we don't seem to have a node_save_failed
event to hook.
Diffstat (limited to 'lib/chef')
6 files changed, 51 insertions, 7 deletions
diff --git a/lib/chef/formatters/error_inspectors/api_error_formatting.rb b/lib/chef/formatters/error_inspectors/api_error_formatting.rb index 5f2a912a01..a87166e168 100644 --- a/lib/chef/formatters/error_inspectors/api_error_formatting.rb +++ b/lib/chef/formatters/error_inspectors/api_error_formatting.rb @@ -1,6 +1,6 @@ #-- # Author:: Daniel DeLeo (<dan@opscode.com>) -# Copyright:: Copyright (c) 2012 Opscode, Inc. +# Copyright:: Copyright (c) 2012-2016 Chef Software, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -36,6 +36,42 @@ chef_server_url "#{server_url}" E end + def describe_eof_error(error_description) + error_description.section("Authentication Error:",<<-E) +Received an EOF on transport socket. This almost always indicates a network +error external to chef-client. Some causes include: + + - Blocking ICMP Dest Unreachable (breaking Path MTU Discovery) + - IPsec or VPN tunnelling breaking Path MTU + - Jumbo frames configured only on one side (breaking Path MTU) + - Jumbo frames configured on a LAN that does not support them + - Proxies or Load Balancers breaking large POSTs + - Broken TCP offload + +Try sending large pings to the destination: + + windows: ping server.example.com -f -l 9999 + unix: ping server.example.com -s 9999 + +Try sending large POSTs to the destination (any HTTP code returned is success): + + e.g.: curl http://server.example.com/`printf '%*s' 9999 '' | tr ' ' 'a'` + +Try disabling TCP Offload Engines (TOE) in your ethernet drivers. + + windows: + Disable-NetAdapterChecksumOffload * -TcpIPv4 -UdpIPv4 -IpIPv4 -NoRestart + Disable-NetAdapterLso * -IPv4 -NoRestart + Set-NetAdapterAdvancedProperty * -DisplayName "Large Receive Offload (IPv4)" -DisplayValue Disabled –NoRestart + Restart-NetAdapter * + unix(bash): + for i in rx tx sg tso ufo gso gro lro rxvlan txvlan rxhash; do /sbin/ethtool -K eth0 $i off; done + +In some cases the underlying virtualization layer (Xen, VMware, KVM, Hyper-V, etc) may have +broken networking. + E + end + def describe_401_error(error_description) if clock_skew? error_description.section("Authentication Error:",<<-E) diff --git a/lib/chef/formatters/error_inspectors/cookbook_resolve_error_inspector.rb b/lib/chef/formatters/error_inspectors/cookbook_resolve_error_inspector.rb index a1f2c8ce37..b5b31454be 100644 --- a/lib/chef/formatters/error_inspectors/cookbook_resolve_error_inspector.rb +++ b/lib/chef/formatters/error_inspectors/cookbook_resolve_error_inspector.rb @@ -1,6 +1,6 @@ #-- # Author:: Daniel DeLeo (<dan@opscode.com>) -# Copyright:: Copyright (c) 2012 Opscode, Inc. +# Copyright:: Copyright (c) 2012-2016 Chef Software, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -39,6 +39,8 @@ class Chef humanize_http_exception(error_description) when *NETWORK_ERROR_CLASSES describe_network_errors(error_description) + when EOFError + describe_eof_error(error_description) else error_description.section("Unexpected Error:","#{exception.class.name}: #{exception.message}") end @@ -165,4 +167,3 @@ EOM end end end - diff --git a/lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb b/lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb index 30811a6d24..5e4fc0fff1 100644 --- a/lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb +++ b/lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb @@ -1,6 +1,6 @@ #-- # Author:: Daniel DeLeo (<dan@opscode.com>) -# Copyright:: Copyright (c) 2012 Opscode, Inc. +# Copyright:: Copyright (c) 2012-2016 Chef Software, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -45,6 +45,8 @@ class Chef describe_network_errors(error_description) when Net::HTTPServerException, Net::HTTPFatalError humanize_http_exception(error_description) + when EOFError + describe_eof_error(error_description) else error_description.section("Unexpected Error:","#{exception.class.name}: #{exception.message}") end diff --git a/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb b/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb index 6371243624..0212217d01 100644 --- a/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb +++ b/lib/chef/formatters/error_inspectors/node_load_error_inspector.rb @@ -1,6 +1,6 @@ #-- # Author:: Daniel DeLeo (<dan@opscode.com>) -# Copyright:: Copyright (c) 2012 Opscode, Inc. +# Copyright:: Copyright (c) 2012-2016 Chef Software, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -53,6 +53,8 @@ E error_description.section("Relevant Config Settings:",<<-E) client_key "#{api_key}" E + when EOFError + describe_eof_error(error_description) else error_description.section("Unexpected Error:","#{exception.class.name}: #{exception.message}") end diff --git a/lib/chef/formatters/error_inspectors/registration_error_inspector.rb b/lib/chef/formatters/error_inspectors/registration_error_inspector.rb index 312e35adb6..8c070742f7 100644 --- a/lib/chef/formatters/error_inspectors/registration_error_inspector.rb +++ b/lib/chef/formatters/error_inspectors/registration_error_inspector.rb @@ -47,6 +47,8 @@ E error_description.section("Invalid Redirect:",<<-E) Change your server location in client.rb to the server's FQDN to avoid unwanted redirections. E + when EOFError + describe_eof_error(error_description) else "#{exception.class.name}: #{exception.message}" end diff --git a/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb b/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb index 7ba5448227..263c6cddc7 100644 --- a/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb +++ b/lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb @@ -1,7 +1,7 @@ #-- # Author:: Daniel DeLeo (<dan@opscode.com>) # Author:: Tyler Cloke (<tyler@opscode.com>) -# Copyright:: Copyright (c) 2012 Opscode, Inc. +# Copyright:: Copyright (c) 2012-2016 Chef Software, Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -45,6 +45,8 @@ E humanize_http_exception(error_description) when Chef::Exceptions::MissingRole describe_missing_role(error_description) + when EOFError + describe_eof_error(error_description) else error_description.section("Unexpected Error:","#{exception.class.name}: #{exception.message}") end @@ -117,4 +119,3 @@ E end end end - |