Skip to content

Instantly share code, notes, and snippets.

@omry
Created October 18, 2018 01:07
Show Gist options
  • Save omry/4ff9bf91fda1b02c322e00a90158b986 to your computer and use it in GitHub Desktop.
Save omry/4ff9bf91fda1b02c322e00a90158b986 to your computer and use it in GitHub Desktop.
vagrant@workstation:~/learn-chef/.chef$ sudo knife ssh 'name:node1' 'sudo chef-client' --ssh-user vagrant --ssh-password vagrant --attribute ipaddress
10.0.2.15 [2018-10-18T01:00:05+00:00] WARN: *****************************************
10.0.2.15 [2018-10-18T01:00:05+00:00] WARN: Did not find config file: /etc/chef/client.rb, using command line options.
10.0.2.15 [2018-10-18T01:00:05+00:00] WARN: *****************************************
10.0.2.15 Starting Chef Client, version 13.8.5
10.0.2.15 Creating a new client identity for workstation using the validator key.
10.0.2.15 [2018-10-18T01:00:07+00:00] WARN: Failed to read the private key /etc/chef/validation.pem: #<Errno::ENOENT: No such file or directory @ rb_sysopen - /etc/chef/validation.pem>
10.0.2.15
10.0.2.15 ================================================================================
10.0.2.15 Chef encountered an error attempting to create the client "workstation"
10.0.2.15 ================================================================================
10.0.2.15
10.0.2.15 Private Key Not Found:
10.0.2.15 ----------------------
10.0.2.15 Your private key could not be loaded. If the key file exists, ensure that it is
10.0.2.15 readable by chef-client.
10.0.2.15
10.0.2.15 Relevant Config Settings:
10.0.2.15 -------------------------
10.0.2.15 validation_key "/etc/chef/validation.pem"
10.0.2.15
10.0.2.15 System Info:
10.0.2.15 ------------
10.0.2.15 chef_version=13.8.5
10.0.2.15 ruby=ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux]
10.0.2.15 program_name=chef-client worker: ppid=4759;start=01:00:05;
10.0.2.15 executable=/opt/chefdk/bin/chef-client
10.0.2.15
10.0.2.15
10.0.2.15 Running handlers:
10.0.2.15 [2018-10-18T01:00:07+00:00] ERROR: Running exception handlers
10.0.2.15 Running handlers complete
10.0.2.15 [2018-10-18T01:00:07+00:00] ERROR: Exception handlers complete
10.0.2.15 Chef Client failed. 0 resources updated in 01 seconds
10.0.2.15 [2018-10-18T01:00:07+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
10.0.2.15 [2018-10-18T01:00:07+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
10.0.2.15 [2018-10-18T01:00:07+00:00] ERROR: I cannot read /etc/chef/validation.pem, which you told me to use to sign requests!
10.0.2.15 [2018-10-18T01:00:07+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
@omry
Copy link
Author

omry commented Oct 18, 2018

Content of chef-stacktrace.out:

Generated at 2018-10-18 01:00:07 +0000
Chef::Exceptions::PrivateKeyMissing: I cannot read /etc/chef/validation.pem, which you told me to use to sign requests!
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/http/authenticator.rb:95:in rescue in load_signing_key' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/http/authenticator.rb:84:in load_signing_key'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/http/authenticator.rb:42:in initialize' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/http.rb:98:in new'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/http.rb:98:in block in initialize' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/http.rb:97:in each'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/http.rb:97:in initialize' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/server_api.rb:38:in initialize'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/api_client/registration.rb:150:in new' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/api_client/registration.rb:150:in http_api'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/api_client/registration.rb:96:in create' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/api_client/registration.rb:87:in create_or_update'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/api_client/registration.rb:58:in run' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/client.rb:669:in register'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/client.rb:267:in run' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:292:in block in fork_chef_client'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:280:in fork' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:280:in fork_chef_client'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:245:in block in run_chef_client' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/local_mode.rb:44:in with_server_connectivity'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:233:in run_chef_client' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application/client.rb:469:in sleep_then_run_chef_client'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application/client.rb:458:in block in interval_run_chef_client' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application/client.rb:457:in loop'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application/client.rb:457:in interval_run_chef_client' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application/client.rb:441:in run_application'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:59:in run' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/bin/chef-client:26:in <top (required)>'
/usr/bin/chef-client:250:in load' /usr/bin/chef-client:250:in

'

Caused by Errno::ENOENT: No such file or directory @ rb_sysopen - /etc/chef/validation.pem
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/http/authenticator.rb:86:in read' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/http/authenticator.rb:86:in load_signing_key'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/http/authenticator.rb:42:in initialize' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/http.rb:98:in new'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/http.rb:98:in block in initialize' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/http.rb:97:in each'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/http.rb:97:in initialize' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/server_api.rb:38:in initialize'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/api_client/registration.rb:150:in new' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/api_client/registration.rb:150:in http_api'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/api_client/registration.rb:96:in create' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/api_client/registration.rb:87:in create_or_update'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/api_client/registration.rb:58:in run' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/client.rb:669:in register'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/client.rb:267:in run' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:292:in block in fork_chef_client'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:280:in fork' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:280:in fork_chef_client'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:245:in block in run_chef_client' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/local_mode.rb:44:in with_server_connectivity'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:233:in run_chef_client' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application/client.rb:469:in sleep_then_run_chef_client'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application/client.rb:458:in block in interval_run_chef_client' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application/client.rb:457:in loop'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application/client.rb:457:in interval_run_chef_client' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application/client.rb:441:in run_application'
/opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:59:in run' /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/bin/chef-client:26:in <top (required)>'
/usr/bin/chef-client:250:in load' /usr/bin/chef-client:250:in

'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment