0

I looked everywhere to find a solution...I keep on getting this error:

rsync: change_dir "/cygdrive/C/Users/mloch/Desktop/sites/drupalsite1/" failed: Bad file number (9)
rsync: mkdir "/cygdrive/C/Users/mloch/Desktop/sites/drupalsite2" failed: Bad file number (9)
rsync error: error in file IO (code 11) at /usr/src/rsync/rsync-3.0.8/main.c(587) [Receiver=3.0.8]
rsync: connection unexpectedly closed (9 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /usr/src/rsync/rsync-3.0.8/io.c(601) [sender=3.0.8]
Could not rsync from /cygdrive/C/...drupalsite1// to "/cygdrive/C/...drupalsite2//"

Some forums say it might be the that rsync has no access to tmp folder.

1

2 Answers 2

1

Thanks mloch, This is the only solution to this problem I have found after hours and hours of trying everything else...

To get rsync and sql-sync to work on remote server using Windows (w/Aquia) it is necessary to make changes to 2 files filesystem.inc and SqlBase.php.

First delete cygdrive/ from $path = preg_replace('/cygdrive/(\w):/', '/${1}', >str_replace('\', '/', $path)); in line 61 of filesystem.inc and change drush_shell_exec('gzip -d %s', $input_file)

instead of

drush_shell_exec('gunzip %s', $input_file) in line 144 of SqlBase.php

Happy Syncing!

Although in my case all I needed to do is remove the cygdrive/ in filesystem.inc...

It seemed to work fine without changing 'gzip' to 'gunzip'.

Now there's gotta be a better solution to this problem than modifying drush's code, but for now it solves the issue with rsync / sql-sync.

For clarification for others, these files are (most likely) found in:

  • C:\Program Files (x86)\DevDesktop\drush\vendor\drush\drush\includes
  • C:\Program Files (x86)\DevDesktop\drush\vendor\drush\drush\lib\Drush\Sql
3
  • I'm glad it helped! Did your sql-sync work though without the gunzip change?
    – mloch
    Mar 24, 2016 at 5:16
  • I haven't had any issues with sql-sync (or rsync) with leaving the gzip/gunzip as-is. Which is kind of weird because according to the original code, it looks as if its supposed to be gunzip if (drush_shell_exec('gzip -d %s', $input_file)) { $input_file = trim($input_file, '.gz'); } else { return drush_set_error(dt('Failed to decompress input file.')); } ... Whatever... if this part ain't broke, I'm not gonna change it...
    – mdolnik
    Mar 25, 2016 at 2:06
  • Folowing the above I end-up with a code 0 error: ssh -i privatekey.ppk [email protected] "env COLUMNS=177 drush --backend=2 --verbose --strict=0 --root=/home/User/Site.dd [notice] --uri=Site.dd sql-query --file=/tmp/DB_20170214_163301.sql.gz --file-delete 2>&1" 2>&1 X-Powered-By: PHP/5.6.27 Content-type: text/html; charset=UTF-8 [error] Content-type: text/html; charset=UTF-8 , code: 0) Command dispatch complete [notice] Feb 14, 2017 at 16:48
-2

To get rsync and sql-sync to work on remote server using Windows (w/Aquia) it is necessary to make changes to 2 files filesystem.inc and SqlBase.php.

First delete cygdrive/ from $path = preg_replace('/cygdrive/(\w):/', '/${1}', str_replace('\', '/', $path)); in line 61 of filesystem.inc and change drush_shell_exec('gzip -d %s', $input_file)

instead of

drush_shell_exec('gunzip %s', $input_file) in line 144 of SqlBase.php

Happy Syncing!

3
  • "I'll finish later" does not make an answer.
    – DavidPostill
    Feb 28, 2016 at 17:42
  • Thanks Dave, nice to know someone else looks at this question... I need to get back on my laptop to finish the exact answer that solved the problem for me haven't had time yet, but it's better then nothing to set people in the right direction. The first part I figured out myself and the second took a long time of searching (almost by accident)... If you need it desperately I can get it up quicker
    – mloch
    Feb 29, 2016 at 8:12
  • Actually, thanks, I might delete the post and give it a new title since this is a smaller problem of a bigger one
    – mloch
    Feb 29, 2016 at 8:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .