vagrant-aws icon indicating copy to clipboard operation
vagrant-aws copied to clipboard

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

Open codergtam opened this issue 12 years ago • 7 comments

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]

codergtam avatar Apr 02 '13 16:04 codergtam

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?

mitchellh avatar Apr 02 '13 17:04 mitchellh

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/", "[email protected]:/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]


codergtam avatar Apr 02 '13 18:04 codergtam

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!

rhodges avatar Apr 24 '13 18:04 rhodges

I submitted a fix for this: https://github.com/mitchellh/vagrant-aws/pull/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.

databus23 avatar May 06 '13 09:05 databus23

:+1: for fixing this!

Added #77 as another candidate...

tknerr avatar Jun 03 '13 21:06 tknerr

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.

philipbulley avatar Sep 18 '13 11:09 philipbulley

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".

kamilion avatar Feb 01 '19 22:02 kamilion