berkshelf / vagrant-berkshelf

A Vagrant plugin to add Berkshelf integration to the Chef provisioners
Other
378 stars 100 forks source link

Failing "vagrant up" with chef run #112

Closed Govinda-Fichtner closed 10 years ago

Govinda-Fichtner commented 11 years ago

I have a running vagrant vm with working shared folders (e.g. /vagrant in the guest) where the provisioning fails because not all needed folders are present on the guest when the provisioning starts...

It looks like the /tmp/vagrant-chef-1/chef-solo-2 folder is missing, but maybe something else is missing, too.

I added all the logs and information about my environment here: https://gist.github.com/Govinda-Fichtner/7195092

I am actually not sure if this really is a vagrant-berkshelf issue or if it is a problem with vagrant itself. I really hope someone can shed a little light on this issue...

tmatilai commented 11 years ago

Your gist shows that it is vagrant provision that fails. The problem is described in #88.

Since Vagrant 1.3.0 vagrant up only runs the provisioners when the VM is first created. On subsequent runs you have to explicitly force it with vagrant up --provision. The same with vagrant reload. (I don't like it but that's how it works...)

Govinda-Fichtner commented 11 years ago

@tmatilai Thanks for your help. The --provision flag was exactly what helped. I've been using vagrant for a while with Virtualbox and it seems that there the `vagrant uporvagrant reload`` commands are sufficient.

So yesterday I went to try VMWare Fusion because I often have stability issues with Virtualbox. But I did not realize that the vagrant commands are different with VMWare Fusion. It would have saved me really a lot of time last night if there had been a clearly visible notice regarding this issue somewhere on the Vagrant website... maybe there even is one and I overlooked it. :-)

tmatilai commented 11 years ago

@Govinda-Fichtner No, VirtualBox, Fusion, and all other providers (which use the built-in provision action class) require --provision option for subsequent up/reload commands (see mitchellh/vagrant#1776).

Note that vagrant-berskhelf does run on every vagrant up unless --no-provision is passed. As it happens, I just yesterday to made a PR to fix this in Vagrant: mitchellh/vagrant#2424 =)

Govinda-Fichtner commented 11 years ago

@tmatilai OK. Nice. I always used vagrant-berkshelf as part of my setup. So I was thinking this was the behavior of Vagrant where instead it came from vagrant-berkshelf. Thanks again for the clarification.

tmatilai commented 11 years ago

@Govinda-Fichtner Just to hopefully clarify a bit more. vagrant-berkshelf currently runs by default on all up commands. So it resolves and installs the cookbooks. But Vagrant itself runs the provisioners by default only on fist boot.

And vagrant provision is broken with Fusion or NFS mounts when using vagrant-berkshelf (or vagrant-librarian).

Govinda-Fichtner commented 11 years ago

@tmatilai Just tried a vagrant provision a couple of seconds ago before I could read your last reply. And it failed... and I was thinking why - it just worked some minutes ago with vagrant up --provision... Maybe it would be a good idea to create a big notice on the berkshelf website about these issues... finding the answers in a github issue here after pulling your hair out for a couple of hours is really frustrating...

tmatilai commented 11 years ago

The why is in #88 as I mentioned. And maybe you could make a pull request for the website. The source seems to be in gh-pages branch in the berkshelf repo.

Disclaimer: I'm not affiliated in any ways with RiotGames or vagrant-berkshelf. Just sticking my nose to everywhere ;)

Govinda-Fichtner commented 11 years ago

@tmatilai Not being able to use vagrant provision with vagrant-berkshelf totally defeats the purpose of using Vagrant/Chef/Berkshelf which is for me to quickly iterate over different versions of my chef cookbooks while instantly seeing what fails and being able to fix it and retest/reprovision again...

I hope there is a fix for this somewhere in the future...

jcbize commented 11 years ago

@Govinda-Fichtner I personally keep an eye on the Vagrant changelog at https://github.com/mitchellh/vagrant/blob/master/CHANGELOG.md. The change causing you trouble here was documented in the 1.3.0/backwards incompatibility section. I agree that it's not very convenient, but that's an issue for the Vagrant project and not vagrant-berkshelf per se. Good luck!

tmatilai commented 11 years ago

@Govinda-Fichtner vargant reload --provision works but is of course much slower. And I have changed to use Vagrant via tesk-kitchen when developing cookbooks. It doesn't suffer from this as it doesn't use vagrant-berkshelf plugin (but shells out to berkshelf install and uploads the cookbooks via scp). Still it would be great to get fixed.

Govinda-Fichtner commented 11 years ago

@tmatilai Totally agree regarding the changelog. Read it now. In my case I was confused by not knowing that vagrant-berkshelf did add behavior to the vagrant up command. Seems like I have to try test-kitchen soon...

sethvargo commented 10 years ago

Still an issue? This seems like more of a vagrant thing.

tmatilai commented 10 years ago

I think this is dupe for #88.

sethvargo commented 10 years ago

Dupe #88