Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rsync_numtries should be disallowed to be < 1 #319

Open
2 tasks done
cryptogopher opened this issue Feb 27, 2023 · 1 comment
Open
2 tasks done

rsync_numtries should be disallowed to be < 1 #319

cryptogopher opened this issue Feb 27, 2023 · 1 comment
Labels

Comments

@cryptogopher
Copy link

cryptogopher commented Feb 27, 2023

Checklist

  • I'm reporting a bug
  • I've searched the bugtracker for similar issues, including closed ones.

What did you do?

Set rsync_numtries to 0 (because I thought that this is the number of retries after failure, not the number of tries in total).

What happened?

I got error not much telling if not deceptive error:

----------------------------------------------------------------------------
rsnapshot encountered an error! The program was invoked with these options:
/usr/bin/rsnapshot -c /etc/rsnapshot/vg0.conf sync 
----------------------------------------------------------------------------
ERROR: /usr/bin/rsync syntax or usage error. Does this version of rsync support --link-dest?
umount: /mnt/rsnapshot: target is busy.
ERROR: Unmount LVM snapshot failed: 8192
  Logical volume vg0/rsnapshot contains a filesystem in use.
ERROR: Removal of LVM snapshot failed: 1280

What did you expect to happen

sync to succeed without error.

After rsync_numtries was set to 1 everything worked as expected.

My configuration

config_version	1.2

snapshot_root	/mnt/snapshots/
no_create_root	1

cmd_cp		/bin/cp
cmd_rm		/bin/rm
cmd_rsync	/usr/bin/rsync
cmd_logger	/usr/bin/logger
cmd_du		/usr/bin/du
cmd_rsnapshot_diff	/usr/bin/rsnapshot-diff

linux_lvm_cmd_lvcreate	/sbin/lvcreate
linux_lvm_cmd_lvremove	/sbin/lvremove
linux_lvm_cmd_mount	/bin/mount
linux_lvm_cmd_umount	/bin/umount

retain	vg0	3650

verbose		2
loglevel	3
logfile	/var/log/rsnapshot.log
lockfile	/run/rsnapshot.pid
stop_on_stale_lockfile		0
one_fs		1

link_dest	1
sync_first	1
use_lazy_deletes	0
rsync_numtries	0

linux_lvm_snapshotsize	5G
linux_lvm_snapshotname	rsnapshot
linux_lvm_vgpath	/dev
linux_lvm_mountpath	/mnt/rsnapshot


backup_script	/etc/rsnapshot/metadata.sh	vg0/metadata/
backup	lvm://vg0/gentoo/	vg0/gentoo/	+rsync_short_args=-AHX

Environment

OS: Gentoo Base System release 2.9
Filesystem: LVM with ext4

Other information

Also 0 should not be default value in: https://github.com/rsnapshot/rsnapshot/blob/master/rsnapshot.conf.default.in - and description there is misleading, stating that this is the number of retries.

@StefanMoch
Copy link
Contributor

Thanks for your bug report.

Confirmed: the example in rsnapshot.conf.default.in is wrong. 0 does not make sense for the total number of tries, minimum needs to be 1. This should be caught by rsnapshot, too.

I will have a look into it in the coming days.

StefanMoch pushed a commit to StefanMoch/rsnapshot that referenced this issue Mar 13, 2023
In preparation for the fix, add testcases for the rsync_numtries
configuration option:

  - 1, okay
  - notanumber, not okay
  - negative number, not okay

These are already correctly validated.

rsnapshot#319
StefanMoch pushed a commit to StefanMoch/rsnapshot that referenced this issue Mar 13, 2023
Since this is the number of tries – and not retries –, rsync_numtries
needs to be at least 1. This fixes the validation code for this
configuration value, its error message, the configuration example, and
related text.

rsnapshot#319
sgpinkus pushed a commit that referenced this issue Mar 15, 2023
Fix validation of rsync_numtries = 0 (refs #319). Add test cases.

Since this is the number of tries – and not retries –, rsync_numtries
needs to be at least 1. This fixes the validation code for this
configuration value, its error message, the configuration example, and
related text.

---------

Co-authored-by: Stefan Moch <stefanmoch@mail.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants