osync
osync copied to clipboard
does not sync with a remote source or target (probably due to rsync-3.2.4)
Describe the bug does not sync with a remote source or target (probably due to rsync-3.2.4)
To Reproduce Steps to reproduce the behavior:
- try to sync with a remote source or target having installed rsync-3.2.4
Expected behavior
- sync
Deviated behavior
- exits with error
rsync: [sender] change_dir "/home/****/'/home/****/targetdirectory/" failed: No such file or directory (2)
Environment (please complete the following information):
- Full osync version (including build): 1.3.0-dev-rc2 build 2021062901
- OS: Archlinux
- Bitness [e.g. x64 or x86]: x64
- Shell (busybox or else): fish
Additional context downgrading to rsync-3.2.3 solves the problem but be careful, somehow it managed to delete all the files from INITIATOR
I've read about rsync 3.2.4 behavior changes here
So far, it seems that some expansion changes were made, except for wildcards.
Could you please run export RSYNC_OLD_ARGS=1
before running osync and report back ?
If this resolves the issue, I'll bake in that option as --old-args
since osync needs to be compatible with all sorts of rsync versions.
I can confirm that with RSYNC_OLD_ARGS=1
on INITIATOR and with rsync-3.2.4 on both INITIATOR and TARGET, osync works without errors.
Had the same issue and RSYNC_OLD_ARGS helped
RSYNC_OPTIONAL_ARGS="--old-args" inside config file stopped with "(ERROR):Cannot copy the deletion list to remote replica". So, "export RSYNC_OLD_ARGS=1" before running "bash ... osync.sh" helped me.
I also experienced the same error on Debian bookworm with local rsync version 3.2.6 protocol version 31, and remote version rsync version 3.2.3 protocol version 31.
After failing RSRYNC_OLD_ARGS=1
properly transferred files, but deleted everything but the .osync_workdir
in local repository.
After resetting the directory from a snapshot (I snapshot before and after each rsync), using RSRYNC_OLD_ARGS=1 works flawlessly, so it should be the conjunction of the first failure and the new sync which provoked the unwanted deletion.
I have also noted that adding to my config RSYNC_OPTIONAL_ARGS="--old-args"
do not work.
Strangely enough, I've encountered this on a very old rsync from RHEL 7 (rsync version 3.1.2 protocol version 31) I've added a general fix for this
Note that it is fixed in commit 988009a. The previous 99f107f still lack an export.
May be it would be cleaner in some future release to adopt the new argument quoting, what is your feeling @deajean.
Well the thing is that I have no idea how to detect which rsync version is used. RHEL7 being a perfect example of using same rsync version with different arguments.
So in order to maximize compatibility, as long as newer rsync supports old args, I'll stick to them.
Btw, commit that fixed this is https://github.com/deajan/osync/commit/b2f221cb8675e285ed0446313075f02b4df02be6