linuxserver / docker-rsnapshot

GNU General Public License v3.0
29 stars 3 forks source link

rsync-3.2.4-r0 has a bug which breaks the `--recursive` flag used by rsnapshot and loops indefinitely #7

Closed Sticklyman1936 closed 2 years ago

Sticklyman1936 commented 2 years ago

linuxserver.io


Expected Behavior

When using rsnapshot with an SSH-based remote it shouldn't hang indefinitely.

Current Behavior

When using rsnapshot with an SSH-based remote it is hanging forever with high CPU usage due to a bug with the version of rsync being used in the container. This has been fixed in the upstream rsync project (https://github.com/WayneD/rsync/issues/346 , https://github.com/WayneD/rsync/commit/fabef23bea6e9963c06e218586fda1a823e3c6bf ), so one either wants to use a later version of rsync with bugfix (not sure if there is an official release yet), or roll-back for now.

Steps to Reproduce

  1. Use the latest tag of https://hub.docker.com/r/linuxserver/rsnapshot
  2. Configure /config/rsnapshot.conf to backup a remote host over ssh (and to potentially use a passwordless ssh keyfile (using ssh-keygen) given that this is meant to run unattended. For example:
    
    # If one wants to use a keyfile, this should go into the config directory (/config) and one needs to override the default SSH command to use said key file. Potentially disable StrictHostKeyChecking for testing purposes (not recommended in production).
    ssh_args    -p 22 -i /config/id_rsa -o "StrictHostKeyChecking no"

Set up a remote backup source

backup user@12.34.56.78:/data/ destination_dir/


3. Copy the public keyfile to the source machine user's ~/.ssh directory (if using).
4. From the rsnapshot container run `rsnapshot alpha` (assuming that the smallest granule is `alpha` as per rsnapshot.conf)
5. With broken rsync it will hang forever

## Environment
**OS:** Unraid 6.10.3
**CPU architecture:** x86_64
**How docker service was installed:** Using the Unraid GUI via the community applications plugin.
<!--- ie. from the official docker repo, from the distro repo, nas OS provided, etc. -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->

## Command used to create docker container (run/create/compose/screenshot)
docker run -d --name='rsnapshot' --net='bridge' -e TZ="Europe/London" -e HOST_OS="Unraid" -e HOST_HOSTNAME="Cubit" -e HOST_CONTAINERNAME="rsnapshot" -e 'PUID'='99' -e 'PGID'='100' -l net.unraid.docker.managed=dockerman -l net.unraid.docker.icon='https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/rsnapshot-icon.png' -v '/mnt/user/appdata/rsnapshot':'/config':'rw' -v '/mnt/user/BACKUP/':'/.snapshots':'rw' -v '/mnt/user/appdata/':'/data':'ro' 'linuxserver/rsnapshot:latest'

## Docker logs
<!--- Provide a full docker log, output of "docker logs rsnapshot" -->
github-actions[bot] commented 2 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

karlshea commented 2 years ago

I'm also running into this issue

karlshea commented 2 years ago

Confirmed fix is rebuilding the Docker image with a newer rsync.

Not opening PR, contributing guidelines say that the package_versions.txt file is generated as part of the build process, so I'm not sure where/how those versions would come from or get set.

aptalca commented 2 years ago

We install rsync from the alpine repo. It looks like it just got updated to 3.2.5 in there earlier today. I triggered a package check build, which should pick it up and update. The new build should be out within a half hour or so.

karlshea commented 2 years ago

Ahh makes sense. With the new build everything works, thank you!