Knife bootstrap command hangs

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.

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.

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.

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. And that could hang for a long time
in certain situations.

Thanks, Galen. I get into the box with “vagrant ssh” and have tried a few curls from inside the box including to 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.

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

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

Thanks. Will do.

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.

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