Closed wizonesolutions closed 11 years ago
What error do you get on Vagrant 1.2?
@mwrather What issue did you get? You mentioned getting an error ("possibly a casualty of Vagrant 1.2") when you tried the plugin.
I've just tested the latest vagrant-unison plugin (v0.0.8) against vagrant 1.2.2, and everything seems to work.
Ah, that's good to know. I'll close this out and @mwrather can chime in if he has anything to say.
Thanks for pinging me @wizonesolutions -- filing an issue for this was on my to-do list. I don't know if the errors I'm seeing are related to regressions in vagrant or to a bug in vagrant-unison
, but here's my bug report.
I'm using latest versions --
$ vagrant -v
Vagrant version 1.2.2
$ vagrant plugin list
berkshelf-vagrant (1.1.2)
vagrant-unison (0.0.8)
$
-- and doing config with chef solo and berkshelf. Unison is installed on my host mac (via brew
) and on the ubuntu VM (via apt
). Here's the relevant section of my Vagrantfile
Vagrant.configure("2") do |config|
# box and networking options
config.sync.host_folder = "src/" #relative to the folder your Vagrantfile is in
config.sync.guest_folder = "src/" #relative to the vagrant home folder -> /home/vagrant
# berkshelf and chef solo config
end
(Here's the full Vagrantfile)
Vagrant Sync fails with errors. Here's the trace:
$ vagrant sync
Uploading {host}::/Users/mwrather/Desktop/beachbum/src/ to {guest}::src/
/Users/mwrather/.vagrant.d/gems/gems/vagrant-unison-0.0.8/lib/vagrant-unison/command.rb:34:in `to_i': NaN (FloatDomainError)
from /Users/mwrather/.vagrant.d/gems/gems/vagrant-unison-0.0.8/lib/vagrant-unison/command.rb:34:in `block (4 levels) in execute'
from /Applications/Vagrant/embedded/gems/gems/net-scp-1.1.0/lib/net/scp.rb:400:in `call'
from /Applications/Vagrant/embedded/gems/gems/net-scp-1.1.0/lib/net/scp.rb:400:in `progress_callback'
from /Applications/Vagrant/embedded/gems/gems/net-scp-1.1.0/lib/net/scp/upload.rb:67:in `upload_file_state'
from /Applications/Vagrant/embedded/gems/gems/net-scp-1.1.0/lib/net/scp/upload.rb:38:in `upload_current_state'
from /Applications/Vagrant/embedded/gems/gems/net-scp-1.1.0/lib/net/scp.rb:387:in `await_response_state'
from /Applications/Vagrant/embedded/gems/gems/net-scp-1.1.0/lib/net/scp.rb:356:in `block (3 levels) in start_command'
from /Applications/Vagrant/embedded/gems/gems/net-ssh-2.6.7/lib/net/ssh/connection/channel.rb:311:in `call'
from /Applications/Vagrant/embedded/gems/gems/net-ssh-2.6.7/lib/net/ssh/connection/channel.rb:311:in `process'
from /Applications/Vagrant/embedded/gems/gems/net-ssh-2.6.7/lib/net/ssh/connection/session.rb:217:in `block in preprocess'
from /Applications/Vagrant/embedded/gems/gems/net-ssh-2.6.7/lib/net/ssh/connection/session.rb:217:in `each'
from /Applications/Vagrant/embedded/gems/gems/net-ssh-2.6.7/lib/net/ssh/connection/session.rb:217:in `preprocess'
from /Applications/Vagrant/embedded/gems/gems/net-ssh-2.6.7/lib/net/ssh/connection/session.rb:200:in `process'
from /Applications/Vagrant/embedded/gems/gems/net-ssh-2.6.7/lib/net/ssh/connection/session.rb:164:in `block in loop'
from /Applications/Vagrant/embedded/gems/gems/net-ssh-2.6.7/lib/net/ssh/connection/session.rb:164:in `loop'
from /Applications/Vagrant/embedded/gems/gems/net-ssh-2.6.7/lib/net/ssh/connection/session.rb:164:in `loop'
from /Applications/Vagrant/embedded/gems/gems/net-ssh-2.6.7/lib/net/ssh/connection/channel.rb:269:in `wait'
from /Applications/Vagrant/embedded/gems/gems/net-scp-1.1.0/lib/net/scp.rb:279:in `upload!'
from /Users/mwrather/.vagrant.d/gems/gems/vagrant-unison-0.0.8/lib/vagrant-unison/command.rb:33:in `block (3 levels) in execute'
from /Users/mwrather/.vagrant.d/gems/gems/vagrant-unison-0.0.8/lib/vagrant-unison/command.rb:30:in `each'
from /Users/mwrather/.vagrant.d/gems/gems/vagrant-unison-0.0.8/lib/vagrant-unison/command.rb:30:in `block (2 levels) in execute'
from /Applications/Vagrant/embedded/gems/gems/net-scp-1.1.0/lib/net/scp.rb:202:in `start'
from /Users/mwrather/.vagrant.d/gems/gems/vagrant-unison-0.0.8/lib/vagrant-unison/command.rb:23:in `block in execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/plugin/v2/command.rb:182:in `block in with_target_vms'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/plugin/v2/command.rb:180:in `each'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/plugin/v2/command.rb:180:in `with_target_vms'
from /Users/mwrather/.vagrant.d/gems/gems/vagrant-unison-0.0.8/lib/vagrant-unison/command.rb:13:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/cli.rb:46:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/environment.rb:467:in `cli'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/bin/vagrant:84:in `<top (required)>'
from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:23:in `load'
from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:23:in `<main>'
@mwrather - I've just updated vagrant-unison to v0.0.9. Please could you try again.
If you're still getting an error, could you post a tree
of your host::src/
folder. I'm wondering if there is perhaps a funky filename that is confusing things.
@mwrather See #4 if you get a Fatal error: Warning: inconsistent state. The archive file is missing on some hosts
error
Version 0.0.9 fixed it -- I now have one-way sync from my host folder to the VM. Thank you -- resolved. :+1:
I was using a very simple tree:
$ tree src/
src/
└── src.txt
0 directories, 1 file
I'm going to continue testing with whole website codebases now; I'll open a new issue if problems arise.
Glad to hear that.
Technically you actually have 2 way sync, although a sync will only be triggered by a change to a file on the host.
Is it non-trivial to trigger a sync on client change as well? In my case, I sometimes use a command-line tool with my sites configured such that it SSH'es in and performs the actions in the context of the VM. Right now I have an rsync routine that syncs stuff back, but it's dumb. I'm assuming Unison can coordinate with itself and sync changes in a smart manner. Willing to try working on a pull request for this if you can point me in the right direction. I'm guessing you bumped into this.
Yeah - triggering unison to run is the tricky part, and one I can't figure out.
If we could figure out how to communicate a file on the remote VM back to the host then we could just copy it using scp - no need for unison at all.
If only vagrant had some kind of eventing system where the host would be notified of events happening in the VM...
On Thursday, 10 October 2013, Kevin Kaland wrote:
Is it non-trivial to trigger a sync on client change as well? In my case, I sometimes use a command-line tool with my sites configured such that it SSH'es in and performs the actions in the context of the VM. Right now I have an rsync routine that syncs stuff back, but it's dumb. I'm assuming Unison can coordinate with itself and sync changes in a smart manner. Willing to try working on a pull request for this if you can point me in the right direction. I'm guessing you bumped into this.
— Reply to this email directly or view it on GitHubhttps://github.com/mrdavidlaing/vagrant-unison/issues/2#issuecomment-26083151 .
David Laing Open source @ City Index - github.com/cityindex http://davidlaing.com Twitter: @davidlaing
Hmm. Maybe I am not familiar with how Unison works. There is no way to tell the instance on the client the host's IP so it can alert it when it sees a file change or has done a sync or something? But the other way around works fine (presumably because of normal file watchers)?
That's my understanding - unless I missed something in the docs.
It would be great if you could prove me wrong! On 12 Oct 2013 19:37, "Kevin Kaland" notifications@github.com wrote:
Hmm. Maybe I am not familiar with how Unison works. There is no way to tell the instance on the client the host's IP so it can alert it when it sees a file change or has done a sync or something? But the other way around works fine (presumably because of normal file watchers)?
— Reply to this email directly or view it on GitHubhttps://github.com/mrdavidlaing/vagrant-unison/issues/2#issuecomment-26203291 .
I may try. Despite Unison's maintenance status, it doesn't seem like any clear competitors have emerged. There's the OwnCloud toolchain, but it's a opaque. There are also the syncing services, but usually those are bound by a storage limit.
@cromulus Last I checked, it was too difficult to install easily on Mac OS X. You have to download the XNU sources and stuff. Maybe worth it, but that kinda put me off.
Ah yeah? I started trying to work on a recipe for it, but it was hard because of XNU. But looks like someone's nailed it now...cool! Thanks for the heads-up.
You can look at what vagrant-vbguest did here: https://github.com/dotless-de/vagrant-vbguest/pull/60