deajan / osync

A robust two way (bidirectional) file sync script based on rsync with fault tolerance, POSIX ACL support, time control and near realtime sync
http://www.netpower.fr/osync
BSD 3-Clause "New" or "Revised" License
932 stars 101 forks source link

Cannot create replica file list in #236

Closed oleggoryunov closed 2 years ago

oleggoryunov commented 2 years ago

Hello, as many other users have indicated - thanks for the utility - first of all! Secondly, I am trying to run it across two Debian servers and come across an error:

"Cannot create replica file list in"

ssh key based authorization works fine based on root user.

When osync starts it successfully creates .osync_workdir and state folders BOTH on local (source) on the REMOTE server (target server). (/root/myapp/test/.osync_workdir/state)

But when it comes to the next step - it gives the following error:

(I tried to use either /root/myapp/test/ remote folder or a simplified version: /test/ remote folder - which was given 777 privileges (to avoid access rights errors).

But both the variants show the same result.

Here is the short log (below is full one):

TIME: 1 - ------------------------------------------------------------- TIME: 1 - Fri Feb 18 15:28:09 UTC 2022 - osync 1.2 script begin. TIME: 1 - ------------------------------------------------------------- TIME: 1 - Sync task [sync_test] launched as root@prod (PID 1463901) TIME: 1 - Checking minimum disk space in local replica [/root/myapp/test/]. TIME: 0 - Checking minimum disk space in remote replica [/root/myapp/test/]. TIME: 3 - Starting synchronization task. TIME: 3 - Creating initiator replica file list [/root/myapp/test/]. TIME: 3 - Creating target replica file list [/root/myapp/test/]. TIME: 3 - Cannot create replica file list in [/root/myapp/test/]. TIME: 3 - Command output env: 'rsync': No such file or directory rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: error in rsync protocol data stream (code 12) at io.c(228) [Receiver=3.2.3] TIME: 4 - osync finished with errors.

To Reproduce Steps to reproduce the behavior:

  1. Setup osync with the following config file / the following parameters (please provide either anonymized)
  2. Directories to synchronize.

    Initiator is the system osync runs on. The initiator directory must be a local path.

    INITIATOR_SYNC_DIR="/root/myapp/test"

Target is the system osync synchronizes to (can be the same system as the initiator in case of local sync tasks). The target directory can be a local or remote path.

TARGET_SYNC_DIR="/home/git/osync/dir2"

TARGET_SYNC_DIR="ssh://root@10.68.130.25//test"

If the target system is remote, you can specify a RSA key (please use full path). If not defined, the default ~/.ssh/id_rsa will be used. See documentation for further information.

SSH_RSA_PRIVATE_KEY="/home/backupuser/.ssh/id_rsa"

  1. Run osync with following parameters

    osync.sh /etc/osync/sync.conf --verbose

  2. Result

Is given above...

Expected behavior A clear and concise description of what you expected to happen.

Deviated behavior How does the actual result deviate from the expected behavior.

Logs

TIME: 1 - ------------------------------------------------------------- TIME: 1 - Fri Feb 18 15:02:46 UTC 2022 - osync 1.2 script begin. TIME: 1 - ------------------------------------------------------------- TIME: 1 - Sync task [sync_test] launched as root@prod (PID 1458804) TIME: 1 - Checking minimum disk space in local replica [/root/myapp/test/]. TIME: 0 - Checking minimum disk space in remote replica [/root/myapp/test/]. TIME: 3 - Starting synchronization task. TIME: 3 - Trying to resume aborted execution on 2022-02-18 14:58:56.593229118 +0000 at task [deleted-list] for initiator. [1] previous tries. TIME: 3 - Trying to resume aborted execution on 2022-02-18 14:58:56.593229118 +0000 as task [replica-tree] for target. [1] previous tries. TIME: 3 - Creating target replica file list [/root/myapp/test/]. TIME: 3 - (CRITICAL):Cannot create replica file list in [/root/myapp/test/]. TIME: 4 - (WARN):Command was [/usr/bin/rsync --rsync-path="__(o_O)__ rsync" -rltD -8 -zz --skip-compress=gz/xz/lz/lzma/lzo/rz/jpg/mp3/mp4/7z/bz2/rar/zip/sfark/s7z/ace/apk/arc/cab/dmg/jar/kgb/lzh/lha/lzx/pak/sfx --no-whole-file -p -o -g --executability --exclude ".osync_workdir" -e "/usr/bin/ssh -C -i /root/.ssh/id_rsa -p 22" --list-only root@10.68.130.25:"/root/myapp/test/" 2> "/tmp/osync.treeList.target.error.1458804.20220218T150245.960258970" | (grep -E "^-|^d|^l" || :) | (awk '{$1=$2=$3=$4="" ;print substr($0,5)}' || :) | (awk 'BEGIN { FS=" -> " } ; { print $1 }' || :) | (grep -v "^.$" || :) | sort > "/tmp/osync.treeList.target.1458804.20220218T150245.960258970"]. TIME: 4 - (WARN):Command output env: 'rsync': No such file or directory rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: error in rsync protocol data stream (code 12) at io.c(228) [Receiver=3.2.3] TIME: 5 - (ERROR):osync finished with errors. TIME: 5 - (ERROR):Cannot send mail (neither mutt, mail, sendmail, sendemail, mailsend (windows) or pfSense mail.php could be used).

Environment (please complete the following information):

oleggoryunov commented 2 years ago

For those facing the same issue: The problem was that rsync was not installed on the remote server. For this to work rsync needs to be on both sides.

The ticket can be closed. Hopes it helps someone

deajan commented 2 years ago

Thanks for reporting back. I'll add this to the docs ;)