# Unauthorized Chef

**URL:** <https://discourse.chef.io/t/unauthorized-chef/7363>\
**Category:** Chef Infra (archive)\
**Created:** [November 24, 2015, 4:38pm UTC](https://discourse.chef.io/t/unauthorized-chef/7363 "2015-11-24T16:38:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![smuckers](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@smuckers](https://discourse.chef.io/u/smuckers)\
**Post date:** [November 24, 2015, 4:38pm UTC](https://discourse.chef.io/t/unauthorized-chef/7363/1 "2015-11-24T16:38:38Z")

</div>

Hi,

This is my first deployment of a chef server and I am getting the following error when I attempt to bootstrap a windows server

## Authentication Error:

Failed to authenticate to the chef server (http 401).

## Server Response:

Failed to authenticate as ‘chef-validator’. Ensure that your node\_name and client key are correct.

## Relevant Config Settings:

chef\_server\_url "[https://chef01.blah.com:443/organizations/blahinf](https://chef01.blah.com:443/organizations/blahinf)"  
validation\_client\_name "blah-validator"  
validation\_key “C:\chef\validation.pem”

If these settings are correct, your validation\_key may be invalid.

[2015-11-24T08:23:22-08:00] ERROR: Running exception handlers  
[2015-11-24T08:23:22-08:00] ERROR: Exception handlers complete  
[2015-11-24T08:23:22-08:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out  
[2015-11-24T08:23:22-08:00] FATAL: Net::HTTPServerException: 401 “Unauthorized”

I have seen some posts on how to reset the validation key, however I am not use the gui just command line. How would I go about doing that?

Thanks

---

<div class="post-metadata">

**Author:** ![jjasghar](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jjasghar/32/1691_2.png) [@jjasghar](https://discourse.chef.io/u/jjasghar)\
**Post date:** [November 24, 2015, 4:47pm UTC](https://discourse.chef.io/t/unauthorized-chef/7363/2 "2015-11-24T16:47:42Z")

</div>

Hi! If i recall correctly, I did [this on Chef Server 11.](http://jjasghar.github.io/blog/2014/03/18/help-i-lost-my-vaildation-dot-pem/) I’m not sure how it’ll work on 12, but maybe it’ll help get you to your resolution. I’ll see if I can write up a new version for 12 in the near future.

---

<div class="post-metadata">

**Author:** ![smuckers](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@smuckers](https://discourse.chef.io/u/smuckers)\
**Post date:** [November 24, 2015, 5:10pm UTC](https://discourse.chef.io/t/unauthorized-chef/7363/3 "2015-11-24T17:10:18Z")

</div>

Thanks for the information. I tried resetting the key but I am getting the following error

ERROR: The object you are looking for could not be found  
Response: Cannot load client blah-validator

I am running the following command form a chef management windows workstation

knife client reregister blah-validator -f blah-validaton.pem

Any help is appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![btm](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/btm/32/1089_2.png) [@btm](https://discourse.chef.io/u/btm)\
**Post date:** [November 24, 2015, 5:11pm UTC](https://discourse.chef.io/t/unauthorized-chef/7363/4 "2015-11-24T17:11:10Z")

</div>

What version of the Chef Server are you using?

---

<div class="post-metadata">

**Author:** ![smuckers](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@smuckers](https://discourse.chef.io/u/smuckers)\
**Post date:** [November 24, 2015, 5:18pm UTC](https://discourse.chef.io/t/unauthorized-chef/7363/5 "2015-11-24T17:18:18Z")

</div>

chef-server 12.2.0

I got it working, my knife.rb file was incorrect it was supposed to be

validation\_client\_name “blahinf-validator”

not  
validation\_client\_name “blah-validator”

Thanks
