-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem reloading Chef shared folders #5199
Comments
@sethvargo I've run into this as well, it appears the caching for synced_folders is preventing the synced_folders being populated while loading the provisioner. The bug was introduced in 155516f. |
Fixed locally by changing https://github.com/mitchellh/vagrant/blob/master/plugins/provisioners/chef/provisioner/chef_solo.rb#L37 to existing = synced_folders(@machine, cached: false) |
Thanks @BlakeMesdag. After more digging, I've found that a VM already experiencing this issue can be fixed by removing the "synced_folders" file (a cache, I presume) and reloading the VM:
Not ideal, but better than destroying the VM and initialising from scratch. |
@markinjapan I did that as well. I think the intent behind the change that was added for caching was to prevent adding duplicate shares from multiple plugins/code paths. The cache file doesn't get cleaned up on halt or on dirty exits though, so it causes this issue. |
thanks for the workaround @markinjapan! this issue affects me too |
Same for me. Thanks @markinjapan. |
Due to these problems: - hashicorp/vagrant#5199 - hashicorp/vagrant#5200
Thanks. I have found this before destroying my Ubuntu Vagrant machine. The rm on the synced_folders works form me. I just update to vagrant version to 1.7.2. |
ouch. Just spent half a day tracking this down as well. Not nice. Thanks for documenting it and the current workarounds. |
Bug happened for me as well - quickfix froma bvoe works as well :) |
Same here with the chef_solo and chef_zero provisioner. Suggested fix in #5199 (comment) helped me to work around |
If you don't want to manually delete the file every time, you can use the vagrant-triggers plugin to add an after hook on reload/halt (replace default with your machine name): Vagrant.configure("2") do |config|
config.trigger.after [:reload, :halt], stdout: true do
`rm .vagrant/machines/default/vmware_fusion/synced_folders`
end
end |
👍 thanks for the different workarounds. but is this going to be fixed with the next update? |
Hopefully it will be if #5217 gets merged in. I'm also having this issue, and that change fixed it for me. |
On windows, I have no synced_folders file nor directory? Thanks. |
I run into this multiple times a day when using a windows vagrant box. Both vagrant 1.7.2 and 1.7.1 are affected on Mac OSX. Anxiously awaiting vagrant 1.7.3 |
I am getting the same issue with chef-zero provisioner (vagrant 1.7.2) this workaround helps. |
I use this workaround in my Vagrantfile
|
I'm also using chef-zero and experiencing this issue. vagrant 1.7.2 |
I can confirm the problem and the workaround. Seems like a pretty major bug that needs fixing asap. |
Thanks to everyone for the workaround, I'm happily deleting this Dir.chdir '..' while !File.exist?('Vagrantfile') |
@mikeAtTealium is the I wanted to place in under Is this possible? Could "virtualbox" be pulled out in the same way? |
+1 on picking up this issue. 5 months for the issue and for a user-submitted PR with a fix with nary a comment from a commiter. Vagrant does feel like a half-abandoned project these days. :( |
Confirmed. This is a very annoying major bug and should really be fixed. |
Vagrant has a bug where it loses track of the berkshelf synced folder. See: hashicorp/vagrant#5199 (comment)
@polobo That variable is an artifact of the way we use some functions in our Vagrantfile so that we can source independent JSON config files for each VM and use the information from those in configuring each VM with different port forwardings, shared folders, network settings, box images and so forth. I put the trigger config in the function that gets called for each VM so that I could appropriately reference the correspondingly named subfolder for each VM that would have the /virtualbox/synced_folders entry underneath it. I think @dgollub just used "default" there as thats what the VM is called if you aren't naming them yourself. About "virtualbox" being pulled out in the same way, sure. If you are using various Virtualization providers, say VMWare or whatever else, if you track which you are using for each VMs, you could pass that as a variable, or if you are simply using a different provider for everything, I'd just change VirtualBox to whatever you are using and it should work assuming Vagrant drops the "synced_folders" file there. I've only been using VirtualBox so I'm not certain. |
Same problem with plain install without Chef using vanilla shell provisioner. Initial
Removing
|
Same here on Window 8.1, vagrant 1.7.2. cd into the box then run 'rm .vagrant/machines/default/virtualbox/synced_folders'. I have to do this every time a provision is needed or it fails at the shared folders menu. |
BTW another trick for workaround that doesn't involve installing plugins is to use an alias:
Then just do You can add the alias to your .bashrc file. |
@dkinzer find have -delete flag. I can't test it, because it doesn't work for me. |
@lukas0krupa sorry to hear your having issues. My example above simply aliases the removal of the synced folder per the recommended workaround prior to invoking the vagrant command. It works perfectly on my Ubuntu 14.10 OS machine but I can't be certain it will work the same on other platforms. |
No worries, I still have other things to solve, maybe I don't need it at all. What I meant, is that you could used: |
@lukas0krupa Ah go it! Thanks for the tip! |
Fixed! |
HOORAY! Thank you @mitchellh !! |
For future reference someone coming here from Google In my case the problem was caused by running |
@mitchellh I upgraded to 1.7.4 today because of this issue, but I still have problems with it. I am using vagrant with libvirt. I have 3 sysnced_folder and I am disabling default one. I am using 9p with mapped accessmode. I am using 'chef_zero' provision where I set synced_folder_type to '9p' as well. When I reload machine and then provision, it will blow up.
Am I doning something wrong ? |
Running into this issue with Vagrant 1.7.4. |
Seemingly resolved by upgrading |
After rebooting a virtual machine configured to use chef-zero, it seems the
vagrant provision
command no longer works, and displays the following error:However, running the
vagrant reload
command doesn't seem to recreate all of the shared folders required for chef-zero to operate:Naturally, the
vagrant provision
command still outputs the same error.Please note, when initially running
vagrant up
, there were 3 shared folders created for chef (roles, nodes, and cookbooks):This looks like a bug, or am I doing something wrong?
Note: I'm running Vagrant 1.7.2 on OS-X Yosemite.
The text was updated successfully, but these errors were encountered: