Rsync error: error in IPC code(code 14) often triggers during the copy of files from one server to another server. This happens due to reasons like SELinux restrictions or issues with the rsync command.
As a part of our Server Management Services, we help our Customers to fix rsync related errors regularly.
Let us today discuss the possible causes and fixes for this error.
What causes the Rsync error: error in IPC code (code 14)?
Often the transfer of files from one server to another using rsync can fail with the error message “Rsync error: error in IPC code (code 14)”. The error in the debug.log would show:
The following command has failed: stderr: rsync: Failed to exec ssh: Permission denied (13) rsync error: error in IPC code (code 14) at pipe.c(84) [receiver=3.0.6] rsync: connection unexpectedly closed (0 bytes received so far) [receiver] rsync error: error in rsync protocol data stream (code 12) at io.c(600) [receiver=3.0.6]
The exact part to stress out here would be the line above the rsync error. Here it states a permission denied error.
The common reasons for this Rsync error include
- SELinux restrictions
- Syntax errors
- SSH client not installed
Let us now look at the solutions to fix this error.
How to fix the Rsync error: error in IPC code (code 14)?
The steps to fix this rsync error depends on the actual reason that triggers it. Let now look at the steps to follow to fix this error in different scenarios.
SELinux is enabled on the destination service node
Selinux is a Linux kernel security feature for access control. When SELinux is running in enforcing mode, it enforces the SELinux policy and denies access based on SELinux policy rules. We could cross-check the status of it using the command below:
It may output a result as shown below:
The result clearly states that SELinux is in enforcing mode. It could be a reason for the rsync to exit with this specific exit code. Thus we could disable SELinux temporarily and perform the transfer. After the completion of the file transfer, we could then revert the status to the enforcing mode
#setenforce 0 //Disables SELinux
#setenforce 1 //Change SELinux to enforcing mode
Also, note to reboot the server to apply changes.
This rsync error can be triggered due to errors in the syntax used. For instance, the following command will trigger the rsync error in the given format
# rsync –progress -avzecP “ssh -p789” /path/from/source/ firstname.lastname@example.org:/path/to/destination/folder rsync: Failed to exec cP: No such file or directory (2) rsync error: error in IPC code (code 14) at pipe.c(84) [sender=3.0.9]
This command has to be replaced as follows:
# rsync –progress -avzcP -e “ssh -p123” /path/from/source/ email@example.com:/path/to/destination/folder or # rsync –progress -avzcPe “ssh -p789” /path/from/source/ firstname.lastname@example.org:/path/to/destination/folder
Apart from the major reasons mentioned above the SSH connection for the file transfer through rsync may fail due to some additional reasons.
If SSH client is not installed in either of the machines, then the connection may not be completed properly. Thus it may trigger the error message. Fix here would be to ensure the install of openssh clients in the servers.
Another possible reason would be the insufficient permission of the user on the corresponding directory. For instance, if we are trying to transfer the files to a folder through a user with no write access on the specified folder, then it may trigger an access denied message with the corresponding error codes. Thus it would be a good idea to cross-check the permission of the user if you see this message.
[Need assistance to fix Rsync error? We’ll help you.]
In short, Rsync error in IPC code (code 14) occurs due to reasons like SELinux restrictions, syntax error, insufficient permission etc. Today we discussed some tips that our Support Engineers follow to fix the Rsync error.