chef-solo provisioner chef install hangs

651 views
Skip to first unread message

Roy Miller

unread,
Mar 28, 2014, 12:43:16 PM3/28/14
to packe...@googlegroups.com
Apparently it hangs effectively forever. I let it sit for an hour as my longest trial. I ran in debug mode and the log file shows this:

014/03/28 12:34:37 ui: [0;32m    local-jenkins: Installing Chef... [0m
2014/03/28 12:34:37 /usr/local/bin/packer-builder-virtualbox-iso: 2014/03/28 12:34:37 opening new ssh session
2014/03/28 12:34:37 ui: [1;32m==> local-jenkins: Provisioning with chef-solo [0m
2014/03/28 12:34:37 /usr/local/bin/packer-builder-virtualbox-iso: 2014/03/28 12:34:37 starting remote command: curl -L https://www.opscode.com/chef/install.sh | sudo bash
2014/03/28 12:34:37 /usr/local/bin/packer-builder-virtualbox-iso: 2014/03/28 12:34:37 [DEBUG] Background SSH connection checker is testing
2014/03/28 12:34:37 ui: [0;32m    local-jenkins: [sudo] password for vagrant:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current [0m
2014/03/28 12:34:37 ui: [0;32m    local-jenkins: Dload  Upload   Total   Spent    Left  Speed [0m
2014/03/28 12:34:38 ui: [0;32m    local-jenkins: 100 14401  100 14401    0     0  35568      0 --:--:-- --:--:-- --:--:-- 35646 [0m
2014/03/28 12:34:41 /usr/local/bin/packer-builder-virtualbox-iso: 2014/03/28 12:34:41 [DEBUG] Background SSH connection checker is testing
2014/03/28 12:34:42 /usr/local/bin/packer-builder-virtualbox-iso: 2014/03/28 12:34:42 [DEBUG] Background SSH connection checker is testing
2014/03/28 12:34:47 /usr/local/bin/packer-builder-virtualbox-iso: 2014/03/28 12:34:47 [DEBUG] Background SSH connection checker is testing
2014/03/28 12:34:52 /usr/local/bin/packer-builder-virtualbox-iso: 2014/03/28 12:34:52 [DEBUG] Background SSH connection checker is testing
2014/03/28 12:34:57 /usr/local/bin/packer-builder-virtualbox-iso: 2014/03/28 12:34:57 [DEBUG] Background SSH connection checker is testing

It looks like the "Background SSH connection checker" keeps trying every 5 seconds, and never passes that point.

Any suggestions about how to get past this?

Roy Miller

unread,
Mar 28, 2014, 3:40:51 PM3/28/14
to packe...@googlegroups.com
Well, nevermind. Apparently this was user error, although I don't understand it. Maybe somebody can explain what's going on. In a nutshell, if I change my chef-solo provisioner declaration to look like this, it works:

    {
      "type": "chef-solo",
      "cookbook_paths": ["../..blah-cookbook/.chef/cookbooks", "../../blahblah-cookbook/.chef/cookbooks"],
      "run_list": ["recipe[blah]", "recipe[blahblah]"],
      "prevent_sudo": false,
      "skip_install": false,
      "execute_command": "echo 'vagrant' | {{if .Sudo}}sudo -S{{end}} chef-solo --no-color -c {{.ConfigPath}} -j {{.JsonPath}} -l debug",
      "install_command": "echo 'vagrant' | {{if .Sudo}}sudo -S{{end}} bash -c 'curl -L https://www.opscode.com/chef/install.sh| bash -s -- -v 11.8'"
    }

The modified execute_command and install_command was the magic. I don't think I necessarily need version 11.8 of Chef, but passing in the "vagrant" password was missing piece (I neglected to mention that I'm trying to provision a Vagrant box). I could have sworn I was running this last week without any modified commands, but I must've been mistaken.

I don't need anything special related to a user password when I use the AWS builder, but I need it when use the virtualbox-iso builder, which what confuses me. Why the difference?

Alvaro Miranda Aguilera

unread,
Mar 29, 2014, 7:24:44 AM3/29/14
to packe...@googlegroups.com
perhaps the vagrantuser doesn't have sudo password less??    :NOPASSWORD




--
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages