I am following the tutorials on chef.io (https://learn.chef.io/tutorials/manage-a-node/ubuntu/bring-your-own-system/run-chef-client-periodically/)
and trying to run a knife ssh command to run chef-client
knife ssh 'role:web' 'sudo chef-client' --ssh-user root --ssh-password 'XXXX' --attribute ipaddress
But getting the following error. Other commands like knife node list
works fine
10.51.231.60 [2017-04-12T15:57:30+05:30] INFO: Forking chef instance to converge
...
10.51.231.60 Starting Chef Client, version 12.19.36
10.51.231.60 [2017-04-12T15:57:30+05:30] INFO: *** Chef 12.19.36 ***
10.51.231.60 [2017-04-12T15:57:30+05:30] INFO: Platform: x86_64-linux
10.51.231.60 [2017-04-12T15:57:30+05:30] INFO: Chef-client pid: 6611
10.51.231.60 [2017-04-12T15:57:34+05:30] INFO: HTTP Request Returned 401 Unautho
rized: error
10.51.231.60
10.51.231.60 ===================================================================
=============
10.51.231.60 Chef encountered an error attempting to load the node data for "nod
e-akajain"
10.51.231.60 ===================================================================
=============
10.51.231.60
10.51.231.60 Authentication Error:
10.51.231.60 ---------------------
10.51.231.60 Failed to authenticate to the chef server (http 401).
10.51.231.60
10.51.231.60 Server Response:
10.51.231.60 ----------------
10.51.231.60 Invalid signature for user or client 'node-akajain'
10.51.231.60
10.51.231.60 Relevant Config Settings:
10.51.231.60 -------------------------
10.51.231.60 chef_server_url "https://fqdn/organizations/akaorg"
10.51.231.60 node_name "node-akajain"
10.51.231.60 client_key "/etc/chef/client.pem"
10.51.231.60
10.51.231.60 If these settings are correct, your client_key may be invalid, or
10.51.231.60 you may have a chef user with the same client name as this node.
10.51.231.60
10.51.231.60 Platform:
10.51.231.60 ---------
10.51.231.60 x86_64-linux
10.51.231.60
10.51.231.60
10.51.231.60 Running handlers:
10.51.231.60 [2017-04-12T15:57:34+05:30] ERROR: Running exception handlers
10.51.231.60 Running handlers complete
10.51.231.60 [2017-04-12T15:57:34+05:30] ERROR: Exception handlers complete
10.51.231.60 Chef Client failed. 0 resources updated in 03 seconds
10.51.231.60 [2017-04-12T15:57:34+05:30] FATAL: Stacktrace dumped to /var/chef/c
ache/chef-stacktrace.out
10.51.231.60 [2017-04-12T15:57:34+05:30] FATAL: Please provide the contents of t
he stacktrace.out file if you file a bug report
10.51.231.60 [2017-04-12T15:57:34+05:30] ERROR: 401 "Unauthorized"
10.51.231.60 [2017-04-12T15:57:34+05:30] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)`