summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-01-27 07:38:02 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-01-27 07:38:02 -0800
commitdaee733688af24312438654dc15d067ad01b168e (patch)
tree2b114f4385fceff09cd97efb42aedde2a6aa2d09 /lib
parent58eff3ad063fb44f14d77239085a9be85325235f (diff)
parent9ee924785e46c7cddc9db13df5de3e10b1de53fa (diff)
downloadchef-daee733688af24312438654dc15d067ad01b168e.tar.gz
Merge pull request #4434 from chef/lcg/better-eof-errors
adds EOFError message to handlers
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/formatters/error_inspectors/api_error_formatting.rb38
-rw-r--r--lib/chef/formatters/error_inspectors/cookbook_resolve_error_inspector.rb5
-rw-r--r--lib/chef/formatters/error_inspectors/cookbook_sync_error_inspector.rb4
-rw-r--r--lib/chef/formatters/error_inspectors/node_load_error_inspector.rb4
-rw-r--r--lib/chef/formatters/error_inspectors/registration_error_inspector.rb2
-rw-r--r--lib/chef/formatters/error_inspectors/run_list_expansion_error_inspector.rb5
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..a327089121 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 / TCP Encapsulation MTU issues
+ - 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 in network drivers/hardware
+
+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 virtual networking code.
+ 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
-