20

I've used from some time rsync/ssh to backup my shared host contents to my personal Synology NAS (212j for that matter), and it worked quite well. For information, I use a password-less ssh connection.

3 days ago, I updated my NAS software and since (or at least I believe it's since that), the backup won't work anymore. I get the following error on the host:

rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Broken pipe (32)
ERROR: module is read only 

..which I do not understand. beside that nothing changed that I know of in both source and destination that can be related to rsync or ssh, I did check a few things and all seems to be alright:

  • I can still connect through ssh from the host to my NAS with the good user, so ssh stuff like keys haven't changed.
  • I also have the correct file permissions on the NAS (I checked, and also tried to create files, directories, .. with the user used by rsync through ssh).

I read here and there that the error means that I have to ensure that my rsyncd.conf have the right read only = no in it, but as far as I know, I never used rsyncd as well as I never configured anything for it and until now it worked like a charm..

I use the following command to do the backup:

rsync -ab --recursive \
--files-from="$FILES_FROM" \
--backup-dir=backup_$SUFFIX \
--delete \
--filter='protect backup_*' \
$WDIRECTORY/ \
remote_backup:$REMOTE_BACKUP/

So I'm stuck and really can't figure out what happened.


Edit:

As suggested in comments, I also tried passing commands to ssh (but not from inside a ssh session), that worked as expected, and also tried a single rsync command, which didnt worked, failing just like the complete backup command.

(sharedHost):hostuser:~ > touch test.txt
(sharedHost):hostuser:~ > rsync test.txt remote_backup:backups/test.txt
ERROR: module is read only
rsync error: syntax or usage error (code 1) at main.c(1034) [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 io.c(601) [sender=3.0.7]

and

(sharedHost):hostuser:~ > ssh remote_backup 'touch /abs_path_to_backups/backups/test2.txt && echo "ProoF" > /abs_path_to_backups/backups/test2.txt'
(sharedHost):hostuser:~ > ssh remote_backup 'cat /abs_path_to_backups/backups/test2.txt'
ProoF
simonpa71
  • 230
user978548
  • 363
  • 2
  • 3
  • 8

6 Answers6

22

I had the same problem after updating my Synology NAS to DSM 4.1. I also do rsync over SSH. In my situation using rsync user root@ip also worked but left the files on the server with owner root which I did not want.

I found in the NAS admin userinterface, that for some reason in ControlPanel->User & Group, click on MyRSyncUser, then Edit->"Permissions" there was no read/write access to the homes. My RSYNC destination is under the homes.

Setting this to privilege worked for me. I hope this helps.

14

I got rid of ERROR: module is read only by changing the remote path from /var/services/homes/rsync to /volume2/homes/rsync

DSM 5.1

Reio
  • 141
5

I encountered the same problem after upgrading a synology ds1010+ to dsm 4.1-2661.

I don't have the time to understand what happened to the rsync provided by synology but it does not seem standard. So here is my workaround...

I didn't want to hack the privileges (multi-user setup), so I've recompiled rsync in static on my laptop, then I've transfered the binary on the sinology nas.

wget https://rsync.samba.org/ftp/rsync/rsync-3.0.9.tar.gz
tar xzvf rsync-3.0.9.tar.gz
cd rsync-3.0.9
export CFLAGS=--static
./configure
make

scp rsync <login>@<nas_hostname>:

You can tell rsync to use your new binary instead of the default one, with this parameter:

--rsync-path=<myhome>/rsync

Now I can continue using duplicity with rsync, by adding the following parameter to duplicity:

--rsync-options="--rsync-path=<myhome>/rsync"
1

I had the same kind of issue, but I wasn't using a dedicated user for rsync.

I had to fix privileges in Control Panel -> Shared folders.

splattne
  • 28,776
0

I had similar issue while connecting to Synology 211j over Putty's ssh. I had to enable

"Control Panel -> Network backup -> Enable network backup service".

It is working now.

-1

I got it working by logging in as root instead of admin or regular user.

Leon
  • 1