Why rsync command is failing with error “rsync error: error starting client-server protocol (code 5) at main.c(1656) [Receiver=3.1.2] [Receiver] _exit_cleanup(code=5, file=main.c, line=1656): about to call exit(5)” ?

https://access.redhat.com/solutions/7005410

Why rsync command is failing with error “rsync error: error starting client-server protocol (code 5) at main.c(1656) [Receiver=3.1.2] [Receiver] _exit_cleanup(code=5, file=main.c, line=1656): about to call exit(5)” ? Solution Verified - Updated June 13 2024 at 7:15 PM - English Environment Red Hat Enterprise Linux 7 Red Hat Enterprise Linux 8 Red Hat Enterprise Linux 9 Issue While executing rsync to share file from a source to destination system we encounter the following error: Raw [root@example ~] # rsync -vvv -az -e ssh root@test::file_name /path opening connection using: ssh -l root test rsync –server –daemon . (8 args) sending daemon args: –server –sender -vvvlogDtprze.iLsfxC . file_name/ (5 args) @ERROR: invalid parameter # This is the parameter for the file rsync error: error starting client-server protocol (code 5) at main.c(1656) [Receiver=3.1.2] [Receiver] _exit_cleanup(code=5, file=main.c, line=1656): about to call exit(5) You have new mail in /var/spool/mail/root Resolution Check the /etc/rsyncd.conf file if it contains any comments (#) on the same line. For example: Raw [root@example ~] # cat /etc/rsyncd.conf log file = /var/log/rsync.log # This is a log file pid file = /var/run/rsyncd.pid # This is a pid file lock file = /var/run/rsync.lock # This is a lock file [files] path = /srv/files # This is the path uid = 0 # This is the uid Remove all the comments appearing on the same line as stanzas.

Verify from the source and destination system if the command is executed successfully.

Root Cause The issue might occur due to incorrect parameters specified in /etc/rsyncd.conf file.

The comment # acts as an argument in /etc/rsyncd.conf file, which may also cause this issue.

Executing the command on wrong source/destination server or with the incorrect filename/path also could be the cause of this issue.

Diagnostic Steps Check the /etc/rsyncd.conf file is configured properly. Make sure no comments # are present on the same line

Check if the rsyncd daemon is running.

Check if the commands are executed on proper source/destination systems with correct file/path name

Updated: