Here, we will see all the possible error types which user may encounter during workstation setup and cookbook creation and their troubleshooting steps accordingly.
If you get an error of this type:
INFO: Client key /etc/chef/client.pem is not present - registering INFO: HTTP Request Returned 401 Unauthorized: Failed to authenticate as ORGANIZATION-validator. Ensure that your node_name and client key are correct. FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out FATAL: Net::HTTPServerException: 401 "Unauthorized"
This means that the organization-validator.pem
file is not getting authenticated. It is a Chef 401 "Unauthorized"
error.
In order to troubleshoot this, the validation key should be regenerated.
In the preceding code, check whether the file is referenced in validation_key
(usually, ORGANIZATION-validator.pem
) exists in one of these locations:
~/.chef ~/projects/current_project/.chef /etc/chef
Check...