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

rsync command doesn't work in windows with cygwin due to broken ControlMaster support #450

Closed
xunnanxu opened this issue Sep 7, 2015 · 4 comments

Comments

@xunnanxu
Copy link
Contributor

xunnanxu commented Sep 7, 2015

The rsync part in knife solo works in linux but fails in windows with cygwin. Typical error messages are:

mm_receive_fd: no message header
process_mux_new_session: failed to receive fd 0 from slave
mux_client_request_session: read from master failed: Connection reset by peer
Failed to connect to new control master
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
ERROR: RuntimeError: Failed to launch command ["rsync", "-rL", "--rsh=ssh [email protected]=auto -o ControlPath=... -o ControlPersist=3600", "--delete-after", "-zt"...

After some research it seems that ssh ControlMaster is still broken in cygwin: http://www.cygwin.com/ml/cygwin/2015-01/msg00123.html

So I manually went to solo_cook.rb and took out the ssh_command part from cmd in the rsync block: so it becomes: cmd = ['rsync', '-rL', rsync_debug, rsync_permissions]

UPDATE: After following the source code carefully this time, I found that it could be turned off by --ssh-control-master=no when running knife solo cook. But this probably should be turned off by default for windows hosts for now.

@matschaffer
Copy link
Owner

Ouch. Well this is probably enough reason to remove it. I've been thinking we may be better off staging everything to a local dir then rsyncing in one shot. It should get most of the same speed gain without this sort of oddity.

In the mean time a PR to skip the control socket stuff for cygwin would certainly be appreciated.

@davidski
Copy link

davidski commented Sep 8, 2015

Thanks to @xunnanxu for the report. As a new knife on windows user, this had been driving me crazy. the --ssh-control-master=no seems to be working for me.

xunnanxu added a commit to xunnanxu/knife-solo that referenced this issue Sep 11, 2015
xunnanxu added a commit to xunnanxu/knife-solo that referenced this issue Sep 11, 2015
matschaffer added a commit that referenced this issue Sep 15, 2015
…ter-cygwin

#450 rsync command doesn't work in windows with cygwin due to broken ControlMaster support
@xunnanxu
Copy link
Contributor Author

I believe I already fixed this long time ago (or this is already superseded in newer version per @matschaffer 's long term plan) so closing this.

@matschaffer
Copy link
Owner

Thanks for the followup @xunnanxu and thanks for the fix! #453

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

No branches or pull requests

3 participants