Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

keep getting rsync error "The source and destination cannot both be remote." #27

Open
codergtam opened this issue Apr 2, 2013 · 7 comments
Labels

Comments

@codergtam
Copy link

Hi,

I am trying to provision a AWS box using below configuration through windows.


Vagrant.configure("2") do |config|
    config.vm.define :web do |web_config|
    web_config.vm.box = "dummy"
web_config.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"

web_config.vm.provider :aws do |aws|
    aws.access_key_id = ###
    aws.secret_access_key = ###
    aws.keypair_name = ###      
    aws.ssh_username = "ubuntu"
    aws.ssh_private_key_path = ###      
    aws.instance_type = "m1.small"
    aws.ami = "ami-7914170d"            
end
web_config.ssh.username = "ubuntu"  
  end

But there seems to be an issue with rsync. I keep getting this error:

Host path: C:/Project/vagrant/
Guest path: /vagrant
Error: The source and destination cannot both be remote.
rsync error: syntax or usage error (code 1) at main.c(1135) [receiver=3.0.6]
@mitchellh
Copy link
Owner

Is this running within Cygwin or something of the sort? I haven't tested this very well on Windows. Can you get me the VAGRANT_LOG=debug output as well?

@codergtam
Copy link
Author

Thanks for your quick response.

I tried that in both windows command prompt and Cygwin terminal. Same error. Below is the debug output:


DEBUG ssh: == Net-SSH connection debug-level log END ==
INFO ssh: SSH is ready!
INFO run_instance: Time for SSH ready: 8.788116216659546
INFO interface: info: Machine is booted and ready for use!
[default] Machine is booted and ready for use!
INFO machine: Calling action: read_ssh_info on provider AWS (i-74eecb3e)
INFO runner: Running action: #Vagrant::Action::Builder:0x39a2798
INFO warden: Calling action: #Vagrant::Action::Builtin::ConfigValidate:0x3a30d58
INFO warden: Calling action: #VagrantPlugins::AWS::Action::ConnectAWS:0x3a30d28
INFO connect_aws: Connecting to AWS...
INFO warden: Calling action: #VagrantPlugins::AWS::Action::ReadSSHInfo:0x3ac3cf8
INFO interface: info: Rsyncing folder: C:/Project/vagrant/ => /vagrant
[default] Rsyncing folder: C:/Project/vagrant/ => /vagrant
DEBUG ssh: Re-using SSH connection.
INFO ssh: Execute: mkdir -p '/vagrant' (sudo=true)
DEBUG ssh: stderr: stdin: is not a tty

DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
INFO ssh: Execute: chown ubuntu '/vagrant' (sudo=true)
DEBUG ssh: stderr: stdin: is not a tty

DEBUG ssh: Exit status: 0
INFO subprocess: Starting process: ["rsync", "--verbose", "--archive", "-z", "-e", "ssh -p 22 -o StrictHostKeyChecking=no -i 'C:/Project/vagrant/tim-test2.pem'", "C:/Project/vagrant/", "ubuntu@ec2-xx-xxx-xxx-xxx.eu-west-1.compute.amazonaws.com:/vagrant"]
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stderr: The source and destination cannot both be remote.
rsync error: syntax or usage error (code 1) at main.c(1135) [receiver=3.0.6]
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 1
ERROR warden: Error occurred: There was an error when attemping to rsync a share folder.
Please inspect the error message below for more info.

Host path: C:/Project/vagrant/
Guest path: /vagrant
Error: The source and destination cannot both be remote.
rsync error: syntax or usage error (code 1) at main.c(1135) [receiver=3.0.6]

INFO warden: Beginning recovery process...
INFO warden: Calling recover: #VagrantPlugins::AWS::Action::RunInstance:0x4217988
INFO warden: Recovery complete.
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
ERROR warden: Error occurred: There was an error when attemping to rsync a share folder.
Please inspect the error message below for more info.

Host path: C:/Project/vagrant/
Guest path: /vagrant
Error: The source and destination cannot both be remote.
rsync error: syntax or usage error (code 1) at main.c(1135) [receiver=3.0.6]

INFO warden: Beginning recovery process...
INFO warden: Calling recover: #Vagrant::Action::Builtin::Call:0x399e5f8
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO warden: Recovery complete.
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO environment: Running hook: environment_unload
INFO runner: Running action: #Vagrant::Action::Builder:0x39b61f0
ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: #<VagrantPlugins::AWS::Errors::RsyncError: There was an error when attemping to rsync a share folder.
Please inspect the error message below for more info.

Host path: C:/Project/vagrant/
Guest path: /vagrant
Error: The source and destination cannot both be remote.
rsync error: syntax or usage error (code 1) at main.c(1135) [receiver=3.0.6]

ERROR vagrant: There was an error when attemping to rsync a share folder.
Please inspect the error message below for more info.

Host path: C:/Project/vagrant/
Guest path: /vagrant
Error: The source and destination cannot both be remote.
rsync error: syntax or usage error (code 1) at main.c(1135) [receiver=3.0.6]

ERROR vagrant: C:/cygwin/home/Tim/.vagrant.d/gems/gems/vagrant-aws-0.1.2/lib/vagrant-aws/action/sync_folders.rb:47:in block in call' C:/cygwin/home/Tim/.vagrant.d/gems/gems/vagrant-aws-0.1.2/lib/vagrant-aws/action/sync_folders.rb:21:ineach'
C:/cygwin/home/Tim/.vagrant.d/gems/gems/vagrant-aws-0.1.2/lib/vagrant-aws/action/sync_folders.rb:21:in call' C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/warden.rb:34:incall'
C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/builtin/provision.rb:45:in call' C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/warden.rb:34:incall'
C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/runner.rb:61:in block in run' C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/util/busy.rb:19:inbusy'
C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/runner.rb:61:in run' C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/builtin/call.rb:51:incall'
C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/warden.rb:34:in call' C:/cygwin/home/Tim/.vagrant.d/gems/gems/vagrant-aws-0.1.2/lib/vagrant-aws/action/connect_aws.rb:37:incall'
C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/warden.rb:34:in call' C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/builtin/config_validate.rb:25:incall'
C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/warden.rb:34:in call' C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/builder.rb:109:incall'
C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/runner.rb:61:in block in run' C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/util/busy.rb:19:inbusy'
C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/action/runner.rb:61:in run' C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/machine.rb:129:inaction'
C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/up/command.rb:37:in block in execute' C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/plugin/v2/command.rb:182:inblock in with_target_vms'
C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/plugin/v2/command.rb:180:in each' C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/plugin/v2/command.rb:180:inwith_target_vms'
C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/plugins/commands/up/command.rb:32:in execute' C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/cli.rb:46:inexecute'
C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/environment.rb:406:in cli' C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/bin/vagrant:60:in<top (required)>'
C:/vagrant/vagrant/embedded/gems/bin/vagrant:23:in load' C:/vagrant/vagrant/embedded/gems/bin/vagrant:23:in

'
INFO interface: error: There was an error when attemping to rsync a share folder.
Please inspect the error message below for more info.

Host path: C:/Project/vagrant/
Guest path: /vagrant
Error: The source and destination cannot both be remote.
rsync error: syntax or usage error (code 1) at main.c(1135) [receiver=3.0.6]

There was an error when attemping to rsync a share folder.
Please inspect the error message below for more info.

Host path: C:/Project/vagrant/
Guest path: /vagrant
Error: The source and destination cannot both be remote.
rsync error: syntax or usage error (code 1) at main.c(1135) [receiver=3.0.6]


@rhodges
Copy link

rhodges commented Apr 24, 2013

I am having this issue as well. After a little research I found this: http://superuser.com/questions/337958/rsync-on-windows
It states that rsync considers any directory with a colon to be remote, but you can use cygwin or unix style representations: "/cygdrive/c/dir" or "/c/dir".

Running my rsync commands by hand (as assembled by vagrant-aws) from command prompt gave me read errors, running it from cygwin gave no errors, but also created no files on my EC2 instance. Still some work to be done, but I hope this helps!

@databus23
Copy link
Contributor

I submitted a fix for this:
#67

As all rsync implmentations on windows I know of are based on cygwin I think its safe to convert the homepath to the cygdrive version on windows in general for now.

@tknerr
Copy link
Contributor

tknerr commented Jun 3, 2013

👍 for fixing this!

Added #77 as another candidate...

@philipbulley
Copy link

Having this problem too.
@mitchellh please merge one of the pull requests :)
#77 sounds good as it's tested with the rsync as packaged by cygwin (as opposed to the paid-for cwRsync)
UPDATE: I can confirm that I've tested it on Win7 via Cygwin, works well.

@rtyler rtyler added this to the Halfway there: 0.5.0 milestone Apr 2, 2014
@rtyler rtyler modified the milestone: Halfway there: 0.5.0 Nov 29, 2014
@kamilion
Copy link

kamilion commented Feb 1, 2019

Just ran into this on a machine; running 'where' on rsync revealed:
C:\Program Files (x86)\Primesense\NITE\bin\rsync.exe
A copy of rsync 3.0.9, tucked into the Microsoft Kinect SDK long ago.

Thanks for the reminder of the /cygdrive/ paths, I was able to do a disk to disk copy with rsync -av /cygdrive/i/ /cygdrive/j/ without having to go find another binary, at 2PM on a friday.

Sorry to driveby necropost; but this is one of the top results on google for "rsync windows the source and destination cannot both be remote".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants