rsync not working anymore after upgrading to LE10

  • Dear all,

    I use rsync from "network tools" add-on to backup some of my videos from my Synology NAS to a second device.

    I'm not 100% sure when i tested this the last time, but after reinstallation of one LE Mediacenter to v10 i recognized that I got some "unauthorized privilege" when i try to safe the rsync configuration on my NAS.

    To make a deeper Test, i installed LE 9.2 from scratch on the same server and try to configure rsync on my NAS again. The rsync.conf on my LE is always the same.

    With LE 9.2 i was able to setup rsync without any issue ... Also the the first "sync run" was successful. So far so good ... next i updated my box to LE 10.0 again ... means same configuration ...

    Next I test if i'm able to run the same rsync job again ... but again ... logfiles reports some authentication issues ...

    What have changed on the network integration in LE 10 or is there a change in the rsync bin from "network tools".

    The values in LE/services for network setting is still untouched and the same than in 9.2 ...

    So ....

    Rsync in LE 9.2 is working (and I doubt 9.5 as well)

    RSync in LE 10.0 is not working (both fresh installation and upgrade from working LE 9.2 installation)

    Solutions are appreciated

  • With LE 9.2 i was able to setup rsync without any issue ... Also the the first "sync run" was successful.

    and have you also tested a "first sync run" with LE 10 ?

    ... next i updated my box to LE 10.0 again ... means same configuration ...

    and could also mean old addon's for LE 9.2 running on LE 10 (?!)

    did you also upgrade the addon's for LE 10 ?

    here is a man page for rsync:

    rsync(1) - Linux man page

    see there the "Exit Values".

    if you run the rsync command manually you should get the exit value with "echo $?"

    are both boxes in general pingable ? (LE 10 <=> second box)

    addon "system-tools" gives a console

  • Hi Joe,

    thanks for the reply ...

    and have you also tested a "first sync run" with LE 10 ?

    Yes ... i tested to setup with fresh LE 10 installation and i tested the run with LE 10 upgrade from (running) LE 9.2.6 installation


    and could also mean old addon's for LE 9.2 running on LE 10 (?!)

    did you also upgrade the addon's for LE 10 ?

    No ... in LE 9.2.6 Network-tools are version .104

    in LE 10 (both fresh installation) Network-tools .110

    in Version 9.5 and 9.7 network tools are not available in official repository

    are both boxes pingable ? (LE 10 <=> second box)

    sure both boxes are pingable

    Again ... LE 9.26 is working without issues ...

    LE 10.0 didn't allow the Rsync Server (Synology NAS) to create the rsync folder configured in the "rsync module" in rsync.conf on Rsync Client (LibreELEC).

  • LE 10.0 didn't allow the Rsync Server (Synology NAS) to create the rsync folder configured in the "rsync module" in rsync.conf on Rsync Client (LibreELEC).

    isn't there a ssh involved ?

    are you able to ssh into LE from the the server ?

    try it and run touch a (creates the file named "a" in the current folder).

    Error ?

    I'm rsyncing from a linux box to LE 10 via an bash script without errors here (running LE 10 generic)

    both rsync version (rsync -V) are "protocol version 31"

    are you sure you're try to rsync to an destination under ~/storage

    - assuming generic and RPI disk layout are the same -

    see the Usage section in the man page of rsync: a missing/wrong slash in the rsync command

  • Did you reboot, or logout and log back in via ssh? If yes, then check if the rsync executable exists in /storage/.kodi/addons/virtual.network-tools/bin/.

    The path is set by /etc/profile.d/*, so it requires a relog and/or reboot depending on how you are using the rsync executable for it to be in the system PATH.

    rsync works fine on LE 10.

  • Dear all,

    sure ... ssh is working, system is rebooted, rsync is running, configuration is the same in LE 9.2.6 and LE 10.0 ...

    rsync deamon on LE 10.0 is running and its configured/started with rsyncd.conf from /.config.

    When the Server (Synology NAS) connects to the client (LE 10.0) I use root/libreelec credentials to connect.

    After that I needed to select my rsync module ... and from pop-up windows the right rsync module is shown and i can select the module as well.

    In case of rsync issues or in case of connection issues ... The pop-up window would be empty ... So it's working !!!

    After selecting the rsync sources for backup I need to save the configuration and I should be able to run the first test.

    But unfortunately after pressing the save button and error message appears ...

    "Insufficient privileges to access this destination shared folder. Please contact the destination administrator for assistance"

    This is due the fact that the rsync process will create the destination share and store its rsync notes (synobkpinfo.db) inside.

    Again .. all the same in LE 9.2.6 (working) and LE 10.0 (not working).

    The issue is reproduceable on any system for me ...

    Cheers

  • Ahh, your using rsyncd service (port 873). I am tunneling rsync over ssh (might want to see if Synology has that as an option). The official LE addon that I am using doesn't have a service option only console tools (network-tools addon). Not aware of a service add-on, if one existed prior to LE-10. The only other thing that comes to mind is perhaps you are following these instructions (or similar) to setup rsyncd as a service?

    Personally, I would use rsync over ssh, it's a lot less hassle than running rsync as a service.

  • But unfortunately after pressing the save button and error message appears ...

    "Insufficient privileges to access this destination shared folder. Please contact the destination administrator for assistance"

    This is due the fact that the rsync process will create the destination share and store its rsync notes (synobkpinfo.db) inside.

    I've no idea from that tool running on your NAS.

    and couldn't find out what's the differences between the rsync versions are.

    sorry !

    but some wild guesses:

    where is that "destination" on LE 10 exactly ?

    have you tried to create the directory and the file "synobkpinfo.db" in it (maybe an old synobkpinfo.db from LE 9.x copied) ?

    the password in the first picture is "libreelec" and the IP adress matches ?

    what would be if you unselect "Enable configuration backup (mandatory)" ?

    it seems the second picture is uncomplete.

    there seem to be more config. options further down (?!)

    all I cant do is provide my rsync script :


    please adjust:

    - CLIENT

    - SRC (path !)

    - DEST (path !)

    - LOG (path !)

    script asks for ssh login password on LE10 (if you keep it default it's "libreelec")

    script removes on each run the old Log file.

    it runs that way without errors

    you could add " --dry-run" to "OPTs" line (within the brackets '"' !!!)

    see man page rsync => "--dry-run"

    and/or run the script with "sh -vx ./<scriptname>"

    chmod u+x ./<scriptname> done once (if you're not from the *nix world)

    assuming the NAS run a sort of *nix and "which rsync" expands to something useful

    Edited 6 times, last by GDPR-7 (September 22, 2021 at 1:41 AM).

  • Okay ... this is my "simple" configuration on the LE systems (I'm using this since OpenELEC 6.0,1 on my ATV1) ... It fits my requirements ...

    I have a autostart.sh in /storage/.config/

    #!/bin/sh

    rsync --config=/storage/.config/rsyncd.conf --daemon

    and ... the rsyncd.conf in /storage/.config/

    list = yes

    port = 873

    log file = /var/log/log.rsync

    timeout = 300

    [Synology3_Backup]

    comment = Synology3 Video Backup

    path = /storage/videos/

    max connections = 0

    read only = false

    hosts allow = 192.168.66.251

    uid = root

    gid = root

    ... so no rocket technology ...

    when the rsync server connects to the rsync client "module" (Synology3_Backup) than it creates a directory inside the module to store the files (/storage/videos/Synology3bak ... Synology3bak = name given by me in the setup of the rsync job on Synology NAS) and its "indexdb (synobkpinfo.db)".

    have you tried to create the directory and the file "synobkpinfo.db" in it (maybe an old synobkpinfo.db from LE 9.x copied) ?

    This is not really possible ... the "synobkpinfo.db" depends on the job on the server ... means they have a kind of validator (or something like that). Rsync job on rsync server and synobkpinfo.db do need to have the same validator. But if you upgrade from LE 9.2.6 to LE 10.0, the rsync module is marked as valid on rsync server (because indexdb and job do have the same identifier) and it is possible to start the rsync job, but failing because of authentication/authorization issues.

    But nevertheless I can manually create folders in /storage/videos/ and place a file there ... no issues from any computer (no need to use root/libreelec credentials).


    I'm more thinking in the smb (Samba) implementation on LE 10 ... I know that the support for smb1 is discontinued on most systems, but in LE Configuration smb1 is still available, but nevertheless I doubt that there be a change in the smb implementation starting with 9.95 or so (the configuration in LE Configuration for smb in LE 9.2.6 and LE 10 is exactly the same ...

    I'm running multiple rsync jobs from Synology NAS, also to different LibreELEC hosts, but only systems with LE 10.0 fail ...

    it seems the second picture is uncomplete.

    Sorry, no more options. Just the setting to configure the scheduler ...

  • I've no idea from that tool running on your NAS.

    and couldn't find out what's the differences between the rsync versions are.

    Hmm ... I just imagine that I did a test upgrading from LE 9.2.6 to LE 9.95 but before disabling autoupdate for "network tools".

    After LE upgrade to LE 9.95 "network tools" (rsync v .104) where marked as "incompatible" !!!

    So there must be a change !!!

  • Hmm ... I just imagine that I did a test upgrading from LE 9.2.6 to LE 9.95 but before disabling autoupdate for "network tools".

    After LE upgrade to LE 9.95 "network tools" (rsync v .104) where marked as "incompatible" !!!

    So there must be a change !!!

    sure, that wasn't my argument.

    I meant:

    I couldn't find out what the differences between the rsync version exactly were.

    I could find on github that the version number with a short comment had changed, but not what internal in the source has changed (a direct comparison of both version was impossible [to me])

    I guess you should find a hint why 9.2.6 addons in 9.95 are "incompatible" here (somewhere):

    LibreELEC

    or maybe this one (after very short flying over it):

    Upcoming Changes - LibreELEC

    => change from Python2 to Python3

    In general:

    to me it seems your problems are laying somewhere in

    - user rights on the LE box (seen from the rsync server)

    - network behaviour of the different rsync versions

    I would also suggest to search the INet with keywords "rsync" and your exact "NAS type".

    maybe there is a update for your NAS out that fixes that (too) ...??

    are there no debug options on the NAS, to see what's going on.

    on LE there is one: switch that on and start the rsync from the NAS again...

    I'm more thinking in the smb (Samba) implementation on LE 10

    I somewhat lately saw your comment #9 after I wrote the above and I'm somewhat confused:

    What has SMB with rsync to do ?

    and if needed: SMB/Samba has debug options too, switch them ON !

    what is if you start with a lean rsyncd.conf and debug ON on both ends ?

    means:

    old cruft and defaults should be out e.g. "max connections = 0" is such an default

    and double check all entries e.g. "host allow" correct ? , uid/gid, ..., even when the problem has something to do with rights

    see:

    rsyncd.conf(5) - Linux man page

    config files working yesterday don't mean they will work today too...

    maybe the newer version of rsync now looks somewhat "sharper" to some config options then the prev. version of rsync did ...

    don't know

    in a *nix world you also should mask blanks:

    comment = Synology3 Video Backup

    versus

    comment = "Synology3 Video Backup"

    Edited 6 times, last by GDPR-7 (September 21, 2021 at 10:05 PM).

  • Hmm ... I just imagine that I did a test upgrading from LE 9.2.6 to LE 9.95 but before disabling autoupdate for "network tools".

    After LE upgrade to LE 9.95 "network tools" (rsync v .104) where marked as "incompatible" !!!

    So there must be a change !!!

    Well it may be a newer version of rsync, so that's a possible change. You will probably need to look what version of rsync was running with 9.2.6, and go through the upstream rsync projects changelogs (https://download.samba.org/pub/rsync/NEWS) and documentation to see what new features were introduced that is affecting you. (network-tools 104 and earlier is rsync 3.1.3, 105 and later is rsync 3.2.3)

    Try using "log file" configuration directive and logging something may give you a hint what the issue is. Also, perhaps using strace or tcpdump to see if you can find out whether anything is actually getting to the daemon, and perhaps a basic "telnet" test to see if the port is open & responds, this is where I would start.

    Edited 3 times, last by frakkin64 (September 22, 2021 at 12:12 AM).

  • I couldn't find out what the differences between the rsync version exactly were.

    +++ correction +++

    I couldn't temporary find...

    network-tools version number's and the containing rsync version

    LibreELEC.tv/changelog.txt at fc7984acc19d36613e4e1a2065537bcc45897261 · LibreELEC/LibreELEC.tv · GitHub

    => all network-tool version > 104 contain rsync version 3.2.3

    => all network-tool version < 104 contain rsync version 3.1.3

    change logs (=>News), man pages, etc for the specific rsync version are here:

    rsync

    Edited 2 times, last by GDPR-7 (September 22, 2021 at 12:40 AM).

  • Okay, I post the rsync logs for two different systems ... one with LE 9.2.6 one with LE 10.0 ...

    LE 9.2.6 ...

    LE 10.0 ...

    on LE 9.2.6 and LE 10.0 directory /storage/video/ do have the same file permissions ...

    LE 9.2.6:

    LE 10.0

  • Not sure, but there are a couple of **root** changes in 3.2.0

    • Added ‑‑copy-as=USER option to give some extra security to root-run rsync commands into/from untrusted directories (such as backups and restores).
    • The default systemd config was made stricter by default. For instance, ProtectHome=on (which hides content in /root and /home/USER dirs), ProtectSystem=full (which makes /usr, /boot, & /etc dirs read-only), and PrivateDevices=on (which hides devices). You can override any of these using the standard systemctl edit rsync and add one or more directives under a [Service] heading (and restart the rsync service).

    Would suggest using the debug options and trial / replicate what the synology is doing

  • The default systemd config was made stricter by default. For instance, ProtectHome=on (which hides content in /root and /home/USER dirs), ProtectSystem=full (which makes /usr, /boot, & /etc dirs read-only), and PrivateDevices=on (which hides devices). You can override any of these using the standard systemctl edit rsync and add one or more directives under a [Service] heading (and restart the rsync service).

    This may be relevant for you, it appears to be a bug with glibc 2.32 (which is what LE 10 is using):

    FS#69135 : [rsync] failed to set permissions on ... after update

    Newer glic versions provide a lchmod() that needs /proc mounted (their bug) · Issue #109 · WayneD/rsync · GitHub

    26401 – Regressions in lchmod and fchmodat when /proc is not mounted

    Arch is cherry picking these 2 commits on top of rsync 3.2.3, it seems:

    + # Force HAVE_LCHMOD off for Linux (for now).

    + git cherry-pick -n 85b8dc8abaca96fc3ea7421e09101b6ac41b6718

    + # Work around glibc's lchmod() issue a better way.

    + git cherry-pick -n 9dd62525f3b98d692e031f22c02be8f775966503

  • Okay, I post the rsync logs for two different systems ... one with LE 9.2.6 one with LE 10.0 ...

    As a workaround, can you set in your rsyncd.conf:

    use chroot = no

    And see if that makes any difference?

    Edit: Looking at the Fedora bug, it looks like "use chroot = yes" is the workaround. It's kind of confusing the way it is worded. But try both, I think "no" is the right option based on the Ubuntu description of the issue. My guess is this option is "yes" by default in rsync --daemon.

    Edited 2 times, last by frakkin64 (September 22, 2021 at 1:14 PM).

  • Wow ... thats the solution ...

    use chroot = no (in Module section) works !!!

    this is my updated rsync.conf ...

    list = yes

    port = 873

    log file = /var/log/log.rsync

    timeout = 300

    [Synology3_Backup]

    comment = Synology3 Video Backup

    path = /storage/videos/

    max connections = 0

    use chroot = no

    read only = false

    hosts allow = 192.168.66.251

    uid = root

    gid = root