-
Notifications
You must be signed in to change notification settings - Fork 117
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 issue on Windows - hostname not same as transfer hostname #42
Comments
Please upgrade to v0.4.4, this should fix the problem. |
Installed v0.4.5 and I'm still getting the same error. |
Could you please test if this works. Replace rsync --files-from `cygpath -u '<path-to-tmp-file>'` -az --rsh="ssh -p22" ./ me@myremotehost.com:~/build |
Get this error: C:\dev\depot\MoneyFinder>rsync --files-from "cygpath -u 'C:\Users\Ken\AppData\Local\Temp\4903901a-552b-493a-9012-d |
Use backticks (`) instead of double quotes (") and try again. Just copy the command from the post above if unclear. |
Doesn't like the backticks - also tried double quotes around with the same result rsync --files-from rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you rsync is a file transfer program capable of efficient remote update Usage: rsync [OPTION]... SRC [SRC]... DEST |
Did you manage to work around it somehow? |
when you run this command |
The problem is that I have to figure out if you're on cygwin and then transform this path. There's this tool cygpath (see my comments above). Can you try this and let me know if a path translated with |
Still an issue for me |
Just checked: It doen't work when the path like 'C:\cygwin64\tmp\91393402-b871-4e58-b302-7b723153f9cf' but when the path is like '/cygdrive/c/cygwin64/tmp/abbb4566-8b68-4403-96f9-9155203d067d', works fine: but yesteday I tested it with cwRsync, today I insalled rsync for cygwin and it works |
To sum it up: rsync (not cwRsync) in combination with cypath works for you? |
this command rsync --files-from /cygdrive/c/cygwin64/tmp/3704f930-ac80-403c-beb3-c5e0605b988b -az --rsh="ssh -p22 -i D:\path_to_keys\key.pem" ./ ubuntu@host:~/ works fime for me |
thanks man. one more question, what do you get when running these commands?
|
Sure $ cygpath -u "C:\cygwin64\tmp\91393402-b871-4e58-b302-7b723153f9cf" $ cygpath -u -p "C:\cygwin64\tmp\91393402-b871-4e58-b302-7b723153f9cf" |
what happens when you use this form of the path (i.e. without the Thanks for your collaboration. I'm about to set up a VM with cygwin installed. |
doesn't work, failed to open file. |
I'll investigate the possibilities. Thanks again. |
np :) |
hey, pls take a look how it can be fixed for cygwing / Windows |
I don't really want Flightplan to write files into your repository, but surely this would be a pretty simple workaround. |
yeah, agree, but this workaround works |
maybe, one option is to try scp, it works fine on Windows or to use symlinks |
I just realized that cygwin is not officialy supported by node.js and it's not really working for me. What's the setup you're using? |
Cygwin with rsync, node.js, npm, Windows 7. Node.js fix for cygwin yeah, Windows is not the best environment for node development :) |
Ok, so I ran this And it copied all the files to my web server. So how do I actually activate the flightplan functionality from there? |
You could re-define your TMPDIR - if (process.env['TMPDIR'] === 'C:\\cygwin\\tmp') // or whatever logic you want
{
process.env['TMPDIR'] = '/tmp';
}
var plan = require('flightplan'); |
Hello Why not use https://www.npmjs.com/package/scp2 ! scp2 is greatly powered by ssh2, implemented the scp in a sftp way.
Copy a file to the server and rename it:
Copy a directory to the server:
Copy via glob pattern:
ami44 |
I am still having problems. Could someone please help me? |
What's the exception? What is your code? |
Here is my flightplan file: var plan = require('flightplan');
plan.target('production', [{
host: '50.87.144.81',
username: 'mjr',
port: 2222,
agent: process.env.SSH_AUTH_SOCK
}]);
plan.local(function(local) {
var filesToCopy = local.exec('git ls-files', {silent: true});
local.transfer(filesToCopy, 'public_html/foyerecolecsrs.ca/');
}); Here is the error I get:
I am running windows with cwRsync. |
This is a known issue. Will try to solve it with the next release. |
tmpfile writer to solve rsync problem on windows - issue #42
I am still getting an error when I run flightplan:
|
What shell are you using? I have experienced the same problem using GitBash. It never occurred to me using flightplan from cmd or powershell. |
I am using cmd.exe |
I wanted to setup a VM with these tools once but I failed with node.js/npm. Do you have a good guide for that? On Sat, Mar 28, 2015 at 7:20 PM, Marcel Robitaille
|
Unfortunately, I do not. I have not had very good luck with VMs in the past. |
I actually know how to set up a VM, but not how Windows users use node.js and all the npm fancy on their machines. |
@pstadler I could provide a guide for windows users soon. Setting up flightplan... no... sorry, setting up ssh on windows' powershell or cmd in combination with flightplan was a long journey for me. I ended up using powershell 4.0, scoop, node, openssh, (cw-)rsync, pageant and puttygen.
the transfer looks something like this for me:
@Marcel-Robitaille I also fixed this error once: for me it occured when I tried using cwrsync with the ssh.exe provided by openssh (or git) and not the one that comes with cwrsync. Check your path environment variable and try putting cwrsync before openssh or git. |
@seybsen wow, that sounds like torture. Let me know if you're going to write a guide or something; I've yet to decide whether it's worth the trouble of setting up the whole env on a Windows VM. Anyway, thanks for dropping a couple of lines here. |
@seybsen Thanks for the suggestion. I switched to rsync's ssh. Now I get the following error:
|
@Marcel-Robitaille that's why I added |
I'd suggest you manually ssh into the remote hosts (if this is even possible, don't know about cwRsync and "their ssh client"), in order to get the dialog asking you to confirm signatures. But yeah, placing |
Ok, I think I am getting close. I have changed my flightplan.js file to this: local.exec('rsync -rz --rsh \'\"C:\\Program Files\\rsync\\ssh.exe\" -p2222 -o StrictHostKeyChecking=no\' ./ <user>@<host>:<path>'); I am prompted for my password. After I enter it, I get:
|
I have cwRsync on Window. In my flightplan I have:
plan.remote('windows', function(remote) {
remote.log('Preparing destination...');
remote.exec('rm -rf ' + remoteWindowsPath);
remote.exec('mkdir ' + remoteWindowsPath);
});
// fly windows:
plan.local('windows', function(local) {
local.log('Copy files to remote hosts');
var curDir = local.exec('chdir').stdout + '';
local.transfer(curDir + 'myfile', remoteWindowsPath + '/build');
})
I get the following results:
myremotehost.com ● Preparing destination...
myremotehost.com $ rm -rf ~/build
myremotehost.com ● ok
myremotehost.com $ mkdir ~/build
myremotehost.com ● ok
localhost ● Copy files to remote hosts
localhost $ chdir
localhost > C:\src
localhost ● ok
localhost $ rsync --files-from C:\Users\Ken\AppData\Local\Temp\e228633a-7454-46df-8f52-bf9ad0c72323 -az --rsh="ssh -p22"
./ me@myremotehost.com:~/build
localhost > --files-from hostname is not the same as the transfer hostname
localhost > rsync error: syntax or usage error (code 1) at main.c(1293) [sender=3.1.1]
localhost ● failed with exit code: 1
✈ Error:
rsync --files-from C:\Users\Me\AppData\Local\Temp\e228633a-7454-46df-8f52-bf9ad0c72323 -az --rsh="ssh -p22" ./ me@myremotehost.com:~/build
failed on localhostThe file C:\Users\Me\AppData\Local\Temp\e228633a-7454-46df-8f52-bf9ad0c72323 contains:
I cannot determine how to fix the rysync "--files-from hostname is not the same as the transfer hostname" error. I tried:
rsync myfile -az --rsh="ssh -p22" ./ me@myremotehost.com:~/build
And that transfers the file ok. So it appears the issue is could be resolved by eliminating the --files-from option.
The text was updated successfully, but these errors were encountered: