Chef Node bootstrap fails with error (Failed to authenticate as 'chef-validator'. Ensure that your node_name and client key are correct.)


#1

"[root@onp-devops01 .chef]# knife bootstrap onp-filenet04.onpointe.local -x ramalingareddypeddir -P xxxxxxxx --sudo
Doing old-style registration with the validation key at /home/ramalingareddypeddir/.chef/viewpointe-validator.pem…
Delete your validation key in order to use your user credentials instead

Connecting to onp-filenet04.onpointe.local
onp-filenet04.onpointe.local -----> Existing Chef installation detected
onp-filenet04.onpointe.local Starting the first Chef Client run…
onp-filenet04.onpointe.local Starting Chef Client, version 13.1.31
onp-filenet04.onpointe.local /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/ohai-13.1.0/lib/ohai/mixin/command.rb:35: warning: Insecure world writable dir /usr in PATH, mode 040777
onp-filenet04.onpointe.local Creating a new client identity for onp-filenet04 using the validator key.
onp-filenet04.onpointe.local
onp-filenet04.onpointe.local ================================================================================
onp-filenet04.onpointe.local Chef encountered an error attempting to create the client ""onp-filenet04""
onp-filenet04.onpointe.local ================================================================================
onp-filenet04.onpointe.local
onp-filenet04.onpointe.local Authentication Error:
onp-filenet04.onpointe.local ---------------------
onp-filenet04.onpointe.local Failed to authenticate to the chef server (http 401).
onp-filenet04.onpointe.local
onp-filenet04.onpointe.local Server Response:
onp-filenet04.onpointe.local ----------------
onp-filenet04.onpointe.local Failed to authenticate as ‘chef-validator’. Ensure that your node_name and client key are correct.
onp-filenet04.onpointe.local
onp-filenet04.onpointe.local Relevant Config Settings:
onp-filenet04.onpointe.local -------------------------
onp-filenet04.onpointe.local chef_server_url ““https://onp-devops01.onpointe.local/organizations/viewpointe”” (https://onp-devops01.onpointe.local/organizations/viewpointe’)
onp-filenet04.onpointe.local validation_client_name "“chef-validator”“
onp-filenet04.onpointe.local validation_key “”/etc/chef/validation.pem”"
onp-filenet04.onpointe.local
onp-filenet04.onpointe.local If these settings are correct, your validation_key may be invalid.
onp-filenet04.onpointe.local
onp-filenet04.onpointe.local System Info:
onp-filenet04.onpointe.local ------------
onp-filenet04.onpointe.local chef_version=13.1.31
onp-filenet04.onpointe.local ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
onp-filenet04.onpointe.local program_name=chef-client worker: ppid=1639;start=08:44:34;
onp-filenet04.onpointe.local executable=/opt/chef/bin/chef-client
onp-filenet04.onpointe.local
onp-filenet04.onpointe.local
onp-filenet04.onpointe.local Running handlers:
onp-filenet04.onpointe.local [2017-07-17T08:44:37-05:00] ERROR: Running exception handlers
onp-filenet04.onpointe.local Running handlers complete
onp-filenet04.onpointe.local [2017-07-17T08:44:37-05:00] ERROR: Exception handlers complete
onp-filenet04.onpointe.local Chef Client failed. 0 resources updated in 03 seconds
onp-filenet04.onpointe.local [2017-07-17T08:44:37-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
onp-filenet04.onpointe.local [2017-07-17T08:44:37-05:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
onp-filenet04.onpointe.local [2017-07-17T08:44:37-05:00] ERROR: 401 "“Unauthorized”“
onp-filenet04.onpointe.local [2017-07-17T08:44:37-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)”


#2

I am facing same issue. Any solution to this?


#3

Hello Akajain,

The issue here is we are configuring the node manually with the RSA Token which is generated by the user not for the node. Its all configure issue and also make sure you have both node and your pem file name should be same where pem will have .pem as extension.

If you have Chef Manage installed in that please go ahead and create node from the Chef Manage Console and then generate certificate from manage window itself and use the same certificate to validate your node. This should work fine.

Do let me know if you have any issues.

Thanks
Seshu