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

Rsync not working properly #3925

Closed
wldcordeiro opened this issue May 28, 2014 · 10 comments
Closed

Rsync not working properly #3925

wldcordeiro opened this issue May 28, 2014 · 10 comments

Comments

@wldcordeiro
Copy link

I have a Vagrantbox setup with Rsync and for some reason any changes I make to the VM do not propogate to my host machine, even with using the vagrant rsync command. I've included a link to my VagrantFile.

https://gist.github.com/cc514c7c3441a90ff391

@mitchellh
Copy link
Contributor

What is the output when you run vagrant rsync? Can you include (gist) debug output from vagrant rsync? Output from vagrant up?

Please provide detailed steps to reproduce, your platform, etc. We need as much information as possible to be able to fix this. Everything in your Vagrantfile on first glance looks fine.

@wldcordeiro
Copy link
Author

Output from vagrant rsync
https://gist.github.com/e8c7eb789da1c34aa9dd

Output from vagrant up
https://gist.github.com/fa12cfaeedc103b2121e

I'm on Window 7 Enterprise 64 Bit and have the vagrant-vbguest plugin installed. Otherwise it's all setup as-is. The Rsync I am using is the one located within c:\cygwin64\bin which could possibly be the culprit as it says it's syncing /cygdrive/c/Users/Wellington/Documents/Code/main-d ev-env/ and not c:\Users\Wellington\Documents\Code\main-dev-env.

@mitchellh
Copy link
Contributor

Sorry can you attach the debut put (gist), by running with --debug? Either command is fine.

It looks like on the surface everything is working. The reason a cygwin-style path is shown is because Vagrant detects that the rsync it is using is compiled with cygwin and it requires those paths.

Everything looks good. You may just have a broken rsync, although I've never seen that. I've also just never seen rsync fail like this, very odd.

@wldcordeiro
Copy link
Author

@mitchellh Here is the debug output, fair warning it's really long.
https://gist.github.com/wldcordeiro/48042eb59674f430aba3

@mskoric
Copy link

mskoric commented Jun 3, 2014

Hi, got the same problem.

Tracked it down to this part:

from

C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.6.3\lib\vagrant\util\platform.rb:59

 def cygwin_path(path)
      if cygwin?
        begin
          # First try the real cygpath
          process = Subprocess.execute("cygpath", "-u", "-a", path.to_s)
          return process.stdout.chomp
        rescue Errors::CommandUnavailableWindows
        end
      end

      # Sometimes cygpath isn't available (msys). Instead, do what we
      # can with bash tricks.
      process = Subprocess.execute(
        "bash",
        "--noprofile",
        "--norc",
        "-c", "cd #{Shellwords.escape(path)} && pwd")
      return process.stdout.chomp
    end

It seems that the variable cygwin is not set properly, so cygpath ... isn't executed. Thus the fallback will be executed and there is the problem.

I have installed cygwin and gitbash in parallel.
The problem ist that under gitbash the path is wrongly formatted by "cd path && pwd".

POC:

gitbash:
$ cd C:\projects && pwd
/c/projects

cygwin:

$ cd C:\projects && pwd
/cygdrive/c/projects

so we have 2 problems:

  1. cygwin isn't defined correctly
  2. cygwin and gitbash in parallel makes problem.

for me this works temporarily:

    def cygwin?
      return true 

;)

HTH

Majk

@starrychloe
Copy link

Version 1.5.4 worked, but version 1.6.3 broke. It treats c:\Users as /c/Users, which doesn't work on Windows. It should use the colon: c:/Users.

==> default: Rsyncing folder: /c/Users/Chloe/Documents/ODesk/AIDC/BK-Development/ => /rsync/BK-Development
There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.

Host path: /c/Users/Chloe/Documents/ODesk/AIDC/BK-Development/
Guest path: /rsync/BK-Development
Command: rsync --verbose --archive --delete -z --copy-links --chmod=ugo=rwX --no-perms --no-owner --no-group --rsync-path sudo rsync -e ssh -p 2222 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i 'C:/Users/Chloe/.vagrant.d/insecure_private_key' --exclude .vagrant/ /c/Users/Chloe/Documents/ODesk/AIDC/BK-Development/ vagrant@127.0.0.1:/rsync/BK-Development
Error: Warning: Permanently added '[127.0.0.1]:2222' (RSA) to the list of known hosts.
rsync: change_dir "/c/Users/Chloe/Documents/ODesk/AIDC/BK-Development" failed: No such file or directory (2)
FATAL I/O ERROR: dying to avoid a --delete-during issue with a pre-3.0.7 receiver.
rsync error: requested action not supported (code 4) at /home/lapo/package/rsync-3.0.9-1/src/rsync-3.0.9/flist.c(1800) [sender=3.0.9]

This is from the same console window in which I was using 1.5.4 previously today:

==> default: Rsyncing folder: /cygdrive/c/Users/Chloe/Documents/ODesk/AIDC/BK-Development/ => /rsync/BK-Development

Even if I try to change the line in Vagrantfile to

  config.vm.synced_folder "/cygdrive/c/Users/Chloe/Documents/ODesk/AIDC/BK-Development", "/rsync/BK-Development", type: 'rsync'

Then it tries to synch the root and produces this error

Host path: /
Guest path: /rsync/BK-Development
Command: rsync --verbose --archive --delete -z --copy-links --chmod=ugo=rwX --no-perms --no-owner --no-group --rsync-path sudo rsync -e ssh -p 2222 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i 'C:/Users/Chloe/.vagrant.d/insecure_private_key' --exclude .vagrant/ / vagrant@127.0.0.1:/rsync/BK-Development
Error: Warning: Permanently added '[127.0.0.1]:2222' (RSA) to the list of known hosts.
rsync: opendir "/cygdrive/c/$Recycle.Bin/S-1-5-18" failed: Permission denied (13)
FATAL I/O ERROR: dying to avoid a --delete-during issue with a pre-3.0.7 receiver.
rsync error: requested action not supported (code 4) at /home/lapo/package/rsync-3.0.9-1/src/rsync-3.0.9/flist.c(1800) [sender=3.0.9]

@pgcd
Copy link

pgcd commented Jul 18, 2014

Same problem here - I updated to 1.6.3 from 1.6.2 and rsync broke (apparently due to the change in parameters, since my output is /c/Users...

@pgcd
Copy link

pgcd commented Jul 30, 2014

I think I found a workaround - so far I was running vagrant rsync from a git bash (MINGW32); running it from an actual Cygwin shell removed all errors and seems to work correctly (both vagrant rsync and vagrant rsync-auto).

@schkovich
Copy link

You could change cygdrive prefix from default /cygdrive to /. See #3913

@mitchellh
Copy link
Contributor

This should be fixed. Other various Windows issues are tracked in other bugs, which are still open.

@ghost ghost locked and limited conversation to collaborators Apr 9, 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

6 participants