# Chef bootstrap error

**URL:** <https://discourse.chef.io/t/chef-bootstrap-error/12926>\
**Category:** Chef Infra (archive)\
**Created:** [April 17, 2018, 6:32am UTC](https://discourse.chef.io/t/chef-bootstrap-error/12926 "2018-04-17T06:32:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hello1900](https://avatars.discourse-cdn.com/v4/letter/h/a88e57/32.png) [@hello1900](https://discourse.chef.io/u/hello1900)\
**Post date:** [April 17, 2018, 6:32am UTC](https://discourse.chef.io/t/chef-bootstrap-error/12926/1 "2018-04-17T06:32:27Z")

</div>

Description  
Chef encountered an error attempting to create the client “rh36”

ChefDK Version  
Chef Development Kit Version: 2.4.17  
chef-client version: 13.6.4  
delivery version: master (73ebb72a6c42b3d2ff5370c476be800fee7e5427)  
berks version: 6.3.1  
kitchen version: 1.19.2  
inspec version: 1.45.13

Platform Version  
CentOS7  
Linux rh36 3.10.0-693.el7.x86\_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86\_64 x86\_64 x86\_64 GNU/Linux

Replication Case  
knife bootstrap rh36 --ssh-user lijun --sudo --identity-file ~/.ssh/id\_rsa --node-name rh36 --run-list ‘recipe[learn\_chef\_httpd]’

Stacktrace  
[root@rh36 chef]# cat /var/chef/cache/chef-stacktrace.out  
Generated at 2018-04-13 01:06:17 -0400  
Net::HTTPServerException: 401 “Unauthorized”  
/opt/chef/embedded/lib/ruby/2.4.0/net/http/response.rb:122:in error!’ /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/http.rb:152:inrequest’  
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/http.rb:131:in post’ /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/api\_client/registration.rb:96:increate’  
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/api\_client/registration.rb:87:in create\_or\_update’ /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/api\_client/registration.rb:58:inrun’  
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/client.rb:669:in register’ /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/client.rb:267:inrun’  
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:292:in block in fork\_chef\_client’ /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:280:infork’  
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:280:in fork\_chef\_client’ /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:245:inblock in run\_chef\_client’  
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/local\_mode.rb:44:in with\_server\_connectivity’ /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:233:inrun\_chef\_client’  
/opt/chef/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/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application/client.rb:458:inblock in interval\_run\_chef\_client’  
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application/client.rb:457:in loop’ /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application/client.rb:457:ininterval\_run\_chef\_client’  
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application/client.rb:441:in run\_application’ /opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/application.rb:59:inrun’  
/opt/chef/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/bin/chef-client:26:in \<top (required)\>’ /bin/chef-client:59:inload’  
/bin/chef-client:59:in `

’  
####### Bootstrap outputs #########

lijun@rh66:~/learn-chef/.chef$ knife bootstrap rh36 --ssh-user lijun --sudo --identity-file ~/.ssh/id\_rsa --node-name rh36 --run-list ‘recipe[learn\_chef\_httpd]’  
Doing old-style registration with the validation key at /home/lijun/learn-chef/.chef/learnchef-validator.pem…  
Delete your validation key in order to use your user credentials instead

Connecting to rh36  
rh36 knife sudo password:  
Enter your password:  
rh36  
rh36 -----\> Installing Chef Omnibus (-v 13)  
rh36 downloading [https://omnitruck-direct.chef.io/chef/install.sh](https://omnitruck-direct.chef.io/chef/install.sh)  
rh36 to file /tmp/install.sh.1643/install.sh  
rh36 trying wget…  
rh36 el 7 x86\_64  
rh36 Getting information for chef stable 13 for el…  
rh36 downloading [https://omnitruck-direct.chef.io/stable/chef/metadata?v=13&p=el&pv=7&m=x86\_64](https://omnitruck-direct.chef.io/stable/chef/metadata?v=13&p=el&pv=7&m=x86_64)  
rh36 to file /tmp/install.sh.1648/metadata.txt  
rh36 trying wget…  
rh36 sha1 f69e475eb3bcdeefe761462f05cbf7c7281270ae  
rh36 sha256 39227d13e5ca2ae023627ad63c56a073b7fecf1a68030915b11ce55e9692c214  
rh36 url [https://packages.chef.io/files/stable/chef/13.8.5/el/7/chef-13.8.5-1.el7.x86\_64.rpm](https://packages.chef.io/files/stable/chef/13.8.5/el/7/chef-13.8.5-1.el7.x86_64.rpm)  
rh36 version 13.8.5  
rh36 downloaded metadata file looks valid…  
rh36 downloading [https://packages.chef.io/files/stable/chef/13.8.5/el/7/chef-13.8.5-1.el7.x86\_64.rpm](https://packages.chef.io/files/stable/chef/13.8.5/el/7/chef-13.8.5-1.el7.x86_64.rpm)  
rh36 to file /tmp/install.sh.1648/chef-13.8.5-1.el7.x86\_64.rpm  
rh36 trying wget…  
rh36 Comparing checksum with sha256sum…  
rh36 Installing chef 13  
rh36 installing with rpm…  
rh36 warning: /tmp/install.sh.1648/chef-13.8.5-1.el7.x86\_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY  
rh36 Preparing… ################################# [100%]  
rh36 Updating / installing…  
rh36 1:chef-13.8.5-1.el7 ################################# [100%]  
rh36 Thank you for installing Chef!  
rh36 Starting the first Chef Client run…  
rh36 Starting Chef Client, version 13.8.5  
rh36 Creating a new client identity for rh36 using the validator key.  
rh36  
rh36 ================================================================================  
rh36 Chef encountered an error attempting to create the client “rh36”  
rh36 ================================================================================  
rh36  
rh36 Authentication Error:  
rh36 ---------------------  
rh36 Failed to authenticate to the chef server (http 401).  
rh36  
rh36 Server Response:  
rh36 ----------------  
rh36 Failed to authenticate as ‘learnchef’. Ensure that your node\_name and client key are correct.  
rh36  
rh36 Relevant Config Settings:  
rh36 -------------------------  
rh36 chef\_server\_url “[https://rh56/organizations/learnchef](https://rh56/organizations/learnchef)”  
rh36 validation\_client\_name “learnchef”  
rh36 validation\_key “/etc/chef/validation.pem”  
rh36  
rh36 If these settings are correct, your validation\_key may be invalid.  
rh36  
rh36 System Info:  
rh36 ------------  
rh36 chef\_version=13.8.5  
rh36 ruby=ruby 2.4.3p205 (2017-12-14 revision 61247) [x86\_64-linux]  
rh36 program\_name=chef-client worker: ppid=1643;start=22:36:29;  
rh36 executable=/opt/chef/bin/chef-client  
rh36  
rh36  
rh36 Running handlers:  
rh36 [2018-04-12T22:36:31-04:00] ERROR: Running exception handlers  
rh36 Running handlers complete  
rh36 [2018-04-12T22:36:31-04:00] ERROR: Exception handlers complete  
rh36 Chef Client failed. 0 resources updated in 01 seconds  
rh36 [2018-04-12T22:36:31-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out  
rh36 [2018-04-12T22:36:31-04:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report  
rh36 [2018-04-12T22:36:31-04:00] ERROR: 401 “Unauthorized”  
rh36 [2018-04-12T22:36:31-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

---

<div class="post-metadata">

**Author:** ![hello1900](https://avatars.discourse-cdn.com/v4/letter/h/a88e57/32.png) [@hello1900](https://discourse.chef.io/u/hello1900)\
**Post date:** [April 24, 2018, 11:49am UTC](https://discourse.chef.io/t/chef-bootstrap-error/12926/2 "2018-04-24T11:49:26Z")

</div>

**Environments:**

Hostname: rh56  
role: Chef server

Hostname: rh66  
role: Chef workstation

Hostname: rh36  
role: Linux server (CentOS 7)

**Knife.rb on rh66:**  
lijun@rh66:~/learn-chef/.chef$ _cat knife.rb_  
current\_dir = File.dirname( **FILE** )  
log\_level :info  
log\_location STDOUT  
node\_name “lijun”  
client\_key “#{current\_dir}/lijun.pem”  
validation\_client\_name ‘learnchef’  
validation\_key “#{current\_dir}/learnchef-validator.pem”  
chef\_server\_url “[https://rh56/organizations/learnchef](https://rh56/organizations/learnchef)”  
cache\_type ‘BasicFile’  
cache\_options( :path =\> “#{ENV[‘HOME’]}/.chef/checksums” )  
cookbook\_path ["#{current\_dir}/…/cookbooks"]

lijun@rh66:~/learn-chef/.chef$ _knife ssl check_  
Connecting to host rh56:443  
Successfully verified certificates from `rh56’

lijun@rh66:~/learn-chef/.chef$ _knife bootstrap rh36 --ssh-user lijun --sudo --identity-file ~/.ssh/id\_rsa --node-name rh36 --run-list ‘recipe[learn\_chef\_httpd]’_

This command successfully downloaded and installed Chef, but got authentication error when creating a new client identity for rh36 using validation key.

Please share any ideas to fix this issue. Thanks.

---

<div class="post-metadata">

**Author:** ![simark](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/simark/32/2099_2.png) [@simark](https://discourse.chef.io/u/simark)\
**Post date:** [April 24, 2018, 12:43pm UTC](https://discourse.chef.io/t/chef-bootstrap-error/12926/3 "2018-04-24T12:43:08Z")

</div>

Hi @hello1900,

I would unregister the `rh36` from the chef-server with following commands issued from your chef workstation (rh66):

- `knife client delete rh36`
- `knife node delete rh36`

Also I would delete everything under `/etc/chef/` from your `rh36` node.

After these steps I would try your bootsrap command again
