Skip to content
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

Previous Rsync Exclude setting caused duplicate rsync on rsync-auto #4567

Closed
bartclarkson opened this issue Sep 26, 2014 · 11 comments
Closed

Comments

@bartclarkson
Copy link

I had a problem with rsync__exclude producing unexpected results. I noticed in the console log that my rsync_auto was duplicating a previous setting I'd made in VagrantFile. I did a vagrant destroy and a vagrant up, and the duplication went away. The issue looked like the following.

Vagrant 1.6.5
VirtualBox 4.3.16
OSX

bart-2:vagrant bart$ vagrant rsync-auto
==> default: Doing an initial rsync...
==> default: Rsyncing folder: /local-path/platform/ => /var/www/platform
==> default:   - Exclude: [".vagrant/", ".git/", "app/cache", "app/log", "vendors", "bin/"]
==> default: Rsyncing folder: /local-path/platform/ => /var/www/platform
==> default:   - Exclude: [".vagrant/", ".git/", "app/bootstrap.php.cache", "app/cache/", "vendor/", "build/", "bin/", "web/bundles/", "web/css/", "web/js/", "web/build.js", "app/logs/", ".idea"]
==> default: Watching: /local-path/platform
==> default: Watching: /local-path/platform
@thedgbrt
Copy link

thedgbrt commented Nov 7, 2014

I'm having this issue too. Can't find where the "memory" of the rsync-auto comes form, even after changing the rsynced folders. Have looked into the vm conf files with no success. Would be really nice to be able to do a "rsync-auto --flush-cache" or something similar.

@osroot25
Copy link

osroot25 commented Dec 7, 2014

The memory is stored in, e.g. ./.vagrant/machines/default/virtualbox/synced_folders

The cache is read in plugins/synced_folders/rsync/command/rsync_auto.rb line 51 , or, if you follow, in lib/vagrant/action/builtin/mixin_synced_folders.rb lines 200ff.
and the cache is written at the end of the call() of lib/vagrant/action/builtin/synced_folders i.e. line 120 (or, in mixin_synced_folders lines 66ff.

So normally, this should work, and if I understand it correctly, even the rsync-auto invoked by the listener read the cached options...
Could the cache-writing be so slowly, that the initial rsync of rsync_auto still reads the previous cache?

@osroot25
Copy link

osroot25 commented Dec 7, 2014

additionally, if I remember correctly (and thus perhaps contrary to your after-destroy experience):
this cache (incl. the other files in that dir) isn't cleared/deleted by a vagrant destroy, but should (perhaps even after every halt?)

@thedgbrt
Copy link

thedgbrt commented Dec 7, 2014

The rsync auto settings ARE cleared after a vagrant destroy.
The problem is specifically with rsync auto not being able to UPDATE its values from the vagrant file.

Let's say I initially sync 3 folders with rsync (stated in my vagrantfile), run rsync auto and do some work on my vm: this works fine. If I want to add / remove rsync folders, I would then shut down the box, update the vagrant file and then start it again. However this time if I do rsync-auto, it will still run the original config, not the updated one. Simple rsync (without auto) does work however.

Hope this helps understand the issue, I can do some testing if needed.
I think rsync auto config should be updated on each vagrantfile change.

@swvjeff
Copy link

swvjeff commented Jan 8, 2015

I'm having the same problem. Any progress on this bug?

@thePanz
Copy link

thePanz commented Feb 10, 2015

I can confirm this issue. The solution I found is the following (edit the paths according to your configuration):

vagrant halt
rm .vagrant/machines/default/virtualbox/synched_folders
vagrant up

@m4rcinkowski
Copy link

@thePanz 👍

@philbirnie
Copy link

Thanks @thePanz. That works for me too..

@trompx
Copy link

trompx commented Mar 31, 2015

Thanks I had this problem too. That would be in fact a good thing that the cache be cleared on each vagrant up/reload.

@bartclarkson
Copy link
Author

@thePanz solution is spot on. It was one of those issues that didn't come up again for me once my rsync exclusions stabilized on the symfony2-flavored project I was doing. But, yeah, seems like that file should be rebuilt on up or reload.

@mitchellh
Copy link
Contributor

This can be fixed with a vagrant reload. And works on master!

@ghost ghost locked and limited conversation to collaborators Apr 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants