# Knife bootstrap command hangs

**URL:** <https://discourse.chef.io/t/knife-bootstrap-command-hangs/11016>\
**Category:** Chef Infra (archive)\
**Created:** [June 15, 2017, 9:44pm UTC](https://discourse.chef.io/t/knife-bootstrap-command-hangs/11016 "2017-06-15T21:44:26Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![garyp](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/garyp/32/1883_2.png) [@garyp](https://discourse.chef.io/u/garyp)\
**Post date:** [June 15, 2017, 9:44pm UTC](https://discourse.chef.io/t/knife-bootstrap-command-hangs/11016/1 "2017-06-15T21:44:26Z")

</div>

I’ve just started the Learn Chef Rally tutorials and I’m on the Infrastructure Automation track in the “Manage a Node with Chef Server” tutorial. I’m using the hosted chef environment. I’m on the “Bootstrap your node” step. I’ve created a Vagrant/VirtualBox chef node on my Windows 8.1 machine using a bento/centos-7.2 vagrant box so the chef node just has the OS on it so far. I’ve signed on to the node with vagrant ssh and verified that the node has internet connectivity.

Now I’m trying to bootstrap the node with the following command in PowerShell as shown in the tutorial:

PS C:\temp\Chef\learn-chef\> knife bootstrap localhost --ssh-port 2222 --ssh-user vagrant --sudo --identity-file C:\Te  
Chef.vagrant\machines\default\virtualbox\private\_key --node-name node1-centos --run-list ‘recipe[learn\_chef\_httpd]’

However, the command just sits there and nothing happens. What troubleshooting steps should I follow to see why the knife bootstrap command is not progressing? I’ve tried adding the -VV option but that doesn’t seem to make a difference. I’d like to find out where knife bootstrap is getting stuck.

Thanks.

---

<div class="post-metadata">

**Author:** ![Galen\_Emery1](https://avatars.discourse-cdn.com/v4/letter/g/46a35a/32.png) [@Galen\_Emery1](https://discourse.chef.io/u/Galen_Emery1)\
**Post date:** [June 16, 2017, 2:27pm UTC](https://discourse.chef.io/t/knife-bootstrap-command-hangs/11016/2 "2017-06-16T14:27:40Z")

</div>

Knife bootstrap does most of its work by wrapping around ssh. So debugging  
ssh is the first step. Also, looking at the command you gave, I see

–identity-file C:\Te  
Chef.vagrant\machines\default\virtualbox\private\_key

Is that a transposition error or typo in the command? If that is your path,  
I’d recommend changing things to one without spaces.

Either way, you can try using ssh directly to the box with that key, and  
see if you can get in. If that works, then there’s something going wrong  
with knife, and someone smarter than me can help troubleshoot that side of  
it.

---

<div class="post-metadata">

**Author:** ![garyp](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/garyp/32/1883_2.png) [@garyp](https://discourse.chef.io/u/garyp)\
**Post date:** [June 16, 2017, 3:07pm UTC](https://discourse.chef.io/t/knife-bootstrap-command-hangs/11016/3 "2017-06-16T15:07:22Z")

</div>

Thanks, Galen. Yes, that was a copy/paste error. The command was:

PS C:\temp\Chef\learn-chef\> knife bootstrap localhost --ssh-port 2222 --ssh-user vagrant --sudo --identity-file C:\Temp\Chef.vagrant\machines\default\virtualbox\private\_key --node-name node1-centos --run-list ‘recipe[learn\_chef\_httpd]’

so there are no spaces in it. SSH works fine. I think it has something to do with the organization in hosted chef but I’m not sure.

Thanks.

---

<div class="post-metadata">

**Author:** ![Galen\_Emery1](https://avatars.discourse-cdn.com/v4/letter/g/46a35a/32.png) [@Galen\_Emery1](https://discourse.chef.io/u/Galen_Emery1)\
**Post date:** [June 16, 2017, 4:08pm UTC](https://discourse.chef.io/t/knife-bootstrap-command-hangs/11016/4 "2017-06-16T16:08:28Z")

</div>

You can verify that your knife knows how to talk to your chef server with  
`knife client list`. This performs a simple get request of your chef  
Server. If that command completes successfully, your knife.rb and  
chef-server are communicating correctly.

I might try blowing away the vagrant box you’re working with and rebuilding  
it, verifying that it has internet access. My initial thought based on my  
experience with Vagrant/Vbox on Windows is your VM doesn’t have a route to  
the internet. One of the first things the bootstrap is trying to do is  
grab an install script from [chef.io](http://chef.io). And that could hang for a long time  
in certain situations.

---

<div class="post-metadata">

**Author:** ![garyp](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/garyp/32/1883_2.png) [@garyp](https://discourse.chef.io/u/garyp)\
**Post date:** [June 16, 2017, 5:58pm UTC](https://discourse.chef.io/t/knife-bootstrap-command-hangs/11016/5 "2017-06-16T17:58:43Z")

</div>

Thanks, Galen. I get into the box with “vagrant ssh” and have tried a few curls from inside the box including to [chef.io](http://chef.io) and that all seems to be fine. “knife client list” returns  
garycheftest-validator  
node1-centos

Still not sure what’s going on. But I’m going to blow everything away and start over and see if that makes a difference.

---

<div class="post-metadata">

**Author:** ![garyp](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/garyp/32/1883_2.png) [@garyp](https://discourse.chef.io/u/garyp)\
**Post date:** [June 16, 2017, 7:08pm UTC](https://discourse.chef.io/t/knife-bootstrap-command-hangs/11016/6 "2017-06-16T19:08:38Z")

</div>

I started completely over with a new organization and everything worked fine. It is something with the old organization but I have no idea what. Whom do I contact to have the old organization deleted from Managed Chef?

It’s very frustrating that there’s no option for the knife bootstrap command to print out what it’s doing as it proceeds.

Thanks for your help,  
Gary

---

<div class="post-metadata">

**Author:** ![Galen\_Emery1](https://avatars.discourse-cdn.com/v4/letter/g/46a35a/32.png) [@Galen\_Emery1](https://discourse.chef.io/u/Galen_Emery1)\
**Post date:** [June 16, 2017, 7:30pm UTC](https://discourse.chef.io/t/knife-bootstrap-command-hangs/11016/7 "2017-06-16T19:30:21Z")

</div>

You can send an e-mail to [support@chef.io](mailto:support@chef.io) to request organization  
deletion. Or submit a ticket via: [https://www.chef.io/support/](https://www.chef.io/support/)

---

<div class="post-metadata">

**Author:** ![garyp](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/garyp/32/1883_2.png) [@garyp](https://discourse.chef.io/u/garyp)\
**Post date:** [June 16, 2017, 7:31pm UTC](https://discourse.chef.io/t/knife-bootstrap-command-hangs/11016/8 "2017-06-16T19:31:32Z")

</div>

Thanks. Will do.

---

<div class="post-metadata">

**Author:** ![christensen143](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/christensen143/32/2097_2.png) [@christensen143](https://discourse.chef.io/u/christensen143)\
**Post date:** [October 23, 2017, 12:37pm UTC](https://discourse.chef.io/t/knife-bootstrap-command-hangs/11016/9 "2017-10-23T12:37:47Z")

</div>

I ran into this issue as well and it turned out to be a hostname/fqdn issue for me. I was naming my node something other than the fqdn using the node name that was in the tutorial. When I changed the node name in the command to my fqdn the command completed successfully. Hopefully this saves someone from having to blow away an entire setup.

---

<div class="post-metadata">

**Author:** ![dufus](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@dufus](https://discourse.chef.io/u/dufus)\
**Post date:** [November 23, 2017, 6:31am UTC](https://discourse.chef.io/t/knife-bootstrap-command-hangs/11016/10 "2017-11-23T06:31:41Z")

</div>

Hey thanks christensen, I’ve been following a lab from pluralsight and I hit this issue too.
