I have a standalone Chef server hosted on a Ubuntu 14.04 machine. Installed the server by following https://learn.chef.io/install-and-manage-your-own-chef-server/linux/ by using latest versions.
When I tried to bootstrap a node, it installs client version 11.x and works. But most of the cookbooks in the market is not compatible to client 11 and requires client 12.x.
So, I supplied client version 12.x as parameter to my bootstrap command, which installs client version 12.x to the node to bootstrap. But this time I got HTTP 503 - 503 "Service Unavailable" error and not able to complete bootstrapping.
My Workstation (Mac 10.11.1)
$chef --version
Chef Development Kit Version: 0.10.0
chef-client version: 12.5.1
berks version: 4.0.1
kitchen version: 1.4.2
My Server (Ubuntu 14.04.2)
$ dpkg --status chef
Package: chef
Status: install ok installed
Priority: extra
Section: misc
Installed-Size: 107919
Maintainer: Chef Software, Inc. <[email protected]>
Architecture: amd64
Version: 11.18.12-1
Description: The full stack of chef
License: unknown
Vendor: Omnibus <[email protected]>
Homepage: https://www.getchef.com
$ dpkg --status chef-server-core
Package: chef-server-core
Status: install ok installed
Priority: extra
Section: misc
Installed-Size: 1190291
Maintainer: Chef Software, Inc.
Architecture: amd64
Version: 12.3.1-1
Replaces: private-chef
Conflicts: private-chef
Description: The full stack of chef-server
License: unknown
Vendor: Omnibus <[email protected]>
Homepage: https://www.chef.io
Node (Ubuntu 14.04.2)
$ chef-client -v
Chef: 12.6.0
Here is the error:
Connecting to <nodes_ip>
10.97.151.49 -----> Existing Chef installation detected
10.97.151.49 Starting the first Chef Client run...
10.97.151.49 Starting Chef Client, version 12.6.0
10.97.151.49 Creating a new client identity for web_app_ubuntu using the validator key.
10.97.151.49 [2015-12-25T14:50:47+00:00] WARN: Failed to register new client, 4 tries remaining
10.97.151.49 [2015-12-25T14:50:47+00:00] WARN: Response: HTTP 503 - 503 "Service Unavailable"
10.97.151.49 [2015-12-25T14:52:26+00:00] WARN: Failed to register new client, 3 tries remaining
10.97.151.49 [2015-12-25T14:52:26+00:00] WARN: Response: HTTP 503 - 503 "Service Unavailable"
10.97.151.49 [2015-12-25T14:54:15+00:00] WARN: Failed to register new client, 2 tries remaining
10.97.151.49 [2015-12-25T14:54:15+00:00] WARN: Response: HTTP 503 - 503 "Service Unavailable"
10.97.151.49 [2015-12-25T14:56:01+00:00] WARN: Failed to register new client, 1 tries remaining
10.97.151.49 [2015-12-25T14:56:01+00:00] WARN: Response: HTTP 503 - 503 "Service Unavailable"
10.97.151.49 [2015-12-25T14:57:48+00:00] WARN: Failed to register new client, 0 tries remaining
10.97.151.49 [2015-12-25T14:57:48+00:00] WARN: Response: HTTP 503 - 503 "Service Unavailable"
10.97.151.49
10.97.151.49 Running handlers:
10.97.151.49 [2015-12-25T14:59:36+00:00] ERROR: Running exception handlers
10.97.151.49 Running handlers complete
10.97.151.49 [2015-12-25T14:59:36+00:00] ERROR: Exception handlers complete
10.97.151.49 Chef Client failed. 0 resources updated in 10 minutes 38 seconds
10.97.151.49 [2015-12-25T14:59:36+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
10.97.151.49 [2015-12-25T14:59:36+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
10.97.151.49 [2015-12-25T14:59:36+00:00] ERROR: undefined method `closed?' for nil:NilClass
10.97.151.49 [2015-12-25T14:59:36+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Finally the stack trace at /var/chef/cache/chef-stacktrace.out
Generated at 2015-12-25 16:02:37 +0000
NoMethodError: undefined method `closed?' for nil:NilClass
/opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:325:in `stream_check'
/opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:199:in `read_body'
/opt/chef/embedded/lib/ruby/2.1.0/net/http/response.rb:226:in `body'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/formatters/error_inspectors/registration_error_inspector.rb:139:in `rescue in format_rest_error'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/formatters/error_inspectors/registration_error_inspector.rb:137:in `format_rest_error'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/formatters/error_inspectors/registration_error_inspector.rb:108:in `humanize_http_exception'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/formatters/error_inspectors/registration_error_inspector.rb:27:in `add_explanation'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/formatters/error_mapper.rb:32:in `registration_failed'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/formatters/base.rb:114:in `registration_failed'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/event_dispatch/dispatcher.rb:43:in `call'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/event_dispatch/dispatcher.rb:43:in `block in call_subscribers'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/event_dispatch/dispatcher.rb:34:in `each'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/event_dispatch/dispatcher.rb:34:in `call_subscribers'
(eval):2:in `registration_failed'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/client.rb:623:in `rescue in register'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/client.rb:603:in `register'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/client.rb:255:in `run'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:261:in `block in fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:249:in `fork'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:249:in `fork_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:215:in `block in run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/local_mode.rb:44:in `with_server_connectivity'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:203:in `run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application/client.rb:413:in `block in interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application/client.rb:403:in `loop'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application/client.rb:403:in `interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application/client.rb:393:in `run_application'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:58:in `run'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/bin/chef-client:26:in `<top (required)="">'
/usr/bin/chef-client:54:in `load'
/usr/bin/chef-client:54:in `<main>'
I finally figured out the issue. I am behind a corporate proxy and the error I got "503: Service Unavailable" is not something coming from Chef Server, rather it is coming from the proxy server :( Anyway, using "no_proxy" option and adding Chef Server's fqdn solved the issue. Yes, this still does not answer the question how it works with chef client v11.x, but I am sure that this solved the issue :)