Bug 1388209 - LVM functionality broken after update to 1.4.2
Summary: LVM functionality broken after update to 1.4.2
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: rsnapshot
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: James Hogarth
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-24 18:21 UTC by eduardo.perezesteban
Modified: 2016-12-28 22:15 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-28 22:15:18 UTC
Type: Bug


Attachments (Terms of Use)
/etc/rsnapshot.conf (7.20 KB, text/plain)
2016-10-24 18:21 UTC, eduardo.perezesteban
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github /rsnapshot rsnapshot issues 155 0 None None None 2016-10-27 21:37:09 UTC

Description eduardo.perezesteban 2016-10-24 18:21:24 UTC
Created attachment 1213539 [details]
/etc/rsnapshot.conf

Description of problem:
After updating to 1.4.2, rsnapshot fails with some LVM-related messages.


Version-Release number of selected component (if applicable):
1.4.2

How reproducible:
Always

Steps to Reproduce:
1. Configure rsnapshot as per attached file
2. Execute "rsnapshot sync"


Actual results:
Use of uninitialized value $traps{"linux_lvm_mountpoint"} in numeric eq (==) at /bin/rsnapshot line 3937.
Use of uninitialized value $traps{"linux_lvm_snapshot"} in string ne at /bin/rsnapshot line 3937.
Use of uninitialized value $linux_lvm_oldpwd in concatenation (.) or string at /bin/rsnapshot line 3938.
Use of uninitialized value $linux_lvm_oldpwd in chdir at /bin/rsnapshot line 3940.
Use of chdir('') or chdir(undef) as chdir() is deprecated at /bin/rsnapshot line 3940.
Use of uninitialized value $traps{"linux_lvm_mountpoint"} in numeric eq (==) at /bin/rsnapshot line 3949.
Use of uninitialized value $traps{"linux_lvm_snapshot"} in string ne at /bin/rsnapshot line 3955.
Use of uninitialized value $src in pattern match (m//) at /bin/rsnapshot line 3971.
Use of uninitialized value $src in concatenation (.) or string at /bin/rsnapshot line 3976.
----------------------------------------------------------------------------
rsnapshot encountered an error! The program was invoked with these options:
/bin/rsnapshot sync 
----------------------------------------------------------------------------
ERROR: Could not understand LVM source "" in linux_lvm_parseurl()
Use of uninitialized value $traps{"linux_lvm_mountpoint"} in numeric eq (==) at /bin/rsnapshot line 2036.
Use of uninitialized value $traps{"linux_lvm_snapshot"} in string ne at /bin/rsnapshot line 2042.
Use of uninitialized value $src in pattern match (m//) at /bin/rsnapshot line 3971.
Use of uninitialized value $src in concatenation (.) or string at /bin/rsnapshot line 3976.
ERROR: Could not understand LVM source "" in linux_lvm_parseurl()
Use of uninitialized value $traps{"linux_lvm_mountpoint"} in numeric eq (==) at /bin/rsnapshot line 2036.

Expected results:
No error messages

Additional info:
This worked before recent update.

Comment 1 James Hogarth 2016-10-26 08:58:23 UTC
Thanks for the report - I'll try and duplicate and take a look at what's going on ... just to be clear it's specifically the lvm:// backup that is failing right? If you comment out the lvm source everything else works?

Comment 2 James Hogarth 2016-10-26 10:52:13 UTC
Okay I can't replicate this ...

I've tried to go as close to your config as I can - fedora 24 using an lvm source for backup and it works for me without your error...

This is my test config, which I've modified from defaults to more closely match yours (the usr move stuff I was considering might be a factor but no):

config_version	1.2
snapshot_root	/.snapshots/
no_create_root	1
cmd_cp		/bin/cp
cmd_rm		/bin/rm
cmd_rsync	/usr/bin/rsync
cmd_ssh	/usr/bin/ssh
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	alpha	6
retain	beta	7
retain	gamma	4
verbose		2
loglevel	3
lockfile	/var/run/rsnapshot.pid
link_dest	1
sync_first	1
use_lazy_deletes	1
linux_lvm_snapshotsize	100M
linux_lvm_snapshotname	rsnapshot
linux_lvm_vgpath	/dev
linux_lvm_mountpath	/var/lib/rsnapshot_mount
backup	/home/		localhost/
backup	/etc/		localhost/
backup	/usr/local/	localhost/
backup	lvm://rsnapshot_test/lv_rsnapshot//	rsnapshot_test/lv_rsnapshot/

The source LV is 6G and I've created multiple files in there

running rsnapshot sync is correctly creating the snapshot LV of 100M and copying the data to /.snapshot/.sync before removing the LV snapshot and then rsnapshot alpha is correctly rotating the data.

Can you please do an rpm -V rsnapshot to verify the package and check no other rsnapshot has been put in place from source or similar (it wouldn't surprise me if someone did given the 1.3.1 previously in Fedora) 

It would also be helpful to have a rsnapshot sync run with the loglevel boosted up a notch or two

Comment 3 eduardo.perezesteban 2016-10-26 22:12:46 UTC
"rpm -v rsnapshot" just detected a modified file:

S.5....T.  c /etc/rsnapshot.conf

And this is the output from "rsnapshot sync" with verbose set to 4:

Setting locale to POSIX "C"
echo 8958 > /var/run/rsnapshot.pid 
/usr/local/sbin/pre-backup.sh
mkdir -m 0755 -p /var/local/backup/snapshot/.sync/ 
/usr/bin/rsync -av --delete --numeric-ids --relative --delete-excluded \
    --include-from=/etc/rsnapshot.include \
    --exclude-from=/etc/rsnapshot.exclude \
    --link-dest=/var/local/backup/snapshot/daily.0/delfin/ /boot/ \
    /var/local/backup/snapshot/.sync/delfin/ 
sending incremental file list
created directory /var/local/backup/snapshot/.sync/delfin
[LONG LIST OF FILES FROM /boot REMOVED]

sent 28,720,428 bytes  received 242 bytes  57,441,340.00 bytes/sec
total size is 154,791,976  speedup is 5.39
/usr/bin/rsync -av --delete --numeric-ids --relative --delete-excluded \
    --include-from=/etc/rsnapshot.include \
    --exclude-from=/etc/rsnapshot.exclude \
    --link-dest=/var/local/backup/snapshot/daily.0/delfin/ /etc/ \
    /var/local/backup/snapshot/.sync/delfin/ 
sending incremental file list
[LONG LIST OF FILES FROM /etc REMOVED]

sent 6,240,185 bytes  received 3,241 bytes  4,162,284.00 bytes/sec
total size is 29,159,377  speedup is 4.67
/usr/bin/rsync -av --delete --numeric-ids --relative --delete-excluded \
    --include-from=/etc/rsnapshot.include \
    --exclude-from=/etc/rsnapshot.exclude \
    --link-dest=/var/local/backup/snapshot/daily.0/delfin/ /usr/local/ \
    /var/local/backup/snapshot/.sync/delfin/ 
sending incremental file list
[LONG LIST OF FILES FROM /usr/local REMOVED]

sent 52,981 bytes  received 355 bytes  106,672.00 bytes/sec
total size is 50,630,206  speedup is 949.27
/usr/bin/rsync -av --delete --numeric-ids --relative --delete-excluded \
    --include-from=/etc/rsnapshot.include \
    --exclude-from=/etc/rsnapshot.exclude \
    --link-dest=/var/local/backup/snapshot/daily.0/delfin/ /var/www/ \
    /var/local/backup/snapshot/.sync/delfin/ 
sending incremental file list
/var/

sent 162,195 bytes  received 237 bytes  108,288.00 bytes/sec
total size is 767,746,910  speedup is 4,726.57
/sbin/lvcreate --snapshot --size 2G --name ss_backup /dev/vg_disk1/lv_home 
/bin/mount /dev/vg_disk1/ss_backup /var/local/backup/lvm 
chdir(/var/local/backup/lvm)
/usr/bin/rsync -av --delete --numeric-ids --relative --delete-excluded \
    --include-from=/etc/rsnapshot.include \
    --exclude-from=/etc/rsnapshot.exclude \
    --link-dest=/var/local/backup/snapshot/daily.0/delfin/home/ .// \
    /var/local/backup/snapshot/.sync/delfin/home/ 
sending incremental file list
created directory /var/local/backup/snapshot/.sync/delfin/home
[LONG LIST OF FILES FROM /home REMOVED]

sent 21,774,387,956 bytes  received 74,843 bytes  64,516,926.81 bytes/sec
total size is 195,744,575,336  speedup is 8.99
chdir(/var/local/backup/snapshot)
/bin/umount /var/local/backup/lvm 
/sbin/lvremove --force /dev/vg_disk1/ss_backup 
/usr/bin/rsync -av --delete --numeric-ids --relative --delete-excluded \
    --include-from=/etc/rsnapshot.include \
    --exclude-from=/etc/rsnapshot.exclude --rsh=/usr/bin/ssh -p 22 \
    --link-dest=/var/local/backup/snapshot/daily.0/router/ root@router:/etc \
    /var/local/backup/snapshot/.sync/router/ 
receiving incremental file list
created directory /var/local/backup/snapshot/.sync/router
etc/dnsmasq.conf
etc/dnsmasq.time
etc/config/dhcp

sent 316 bytes  received 29,217 bytes  8,438.00 bytes/sec
total size is 1,005,786  speedup is 34.06
Use of uninitialized value $traps{"linux_lvm_mountpoint"} in numeric eq (==) at /bin/rsnapshot line 3937.
Use of uninitialized value $traps{"linux_lvm_snapshot"} in string ne at /bin/rsnapshot line 3937.
Use of uninitialized value $linux_lvm_oldpwd in concatenation (.) or string at /bin/rsnapshot line 3938.
chdir()
Use of uninitialized value $linux_lvm_oldpwd in chdir at /bin/rsnapshot line 3940.
Use of chdir('') or chdir(undef) as chdir() is deprecated at /bin/rsnapshot line 3940.
Use of uninitialized value $traps{"linux_lvm_mountpoint"} in numeric eq (==) at /bin/rsnapshot line 3949.
Use of uninitialized value $traps{"linux_lvm_snapshot"} in string ne at /bin/rsnapshot line 3955.
Use of uninitialized value $src in pattern match (m//) at /bin/rsnapshot line 3971.
Use of uninitialized value $src in concatenation (.) or string at /bin/rsnapshot line 3976.
----------------------------------------------------------------------------
rsnapshot encountered an error! The program was invoked with these options:
/bin/rsnapshot sync 
----------------------------------------------------------------------------
ERROR: Could not understand LVM source "" in linux_lvm_parseurl()
/usr/bin/logger -p user.err -t rsnapshot[8958] /bin/rsnapshot sync: ERROR: \
    Could not understand LVM source "" in linux_lvm_parseurl() 
Use of uninitialized value $traps{"linux_lvm_mountpoint"} in numeric eq (==) at /bin/rsnapshot line 2036.
Use of uninitialized value $traps{"linux_lvm_snapshot"} in string ne at /bin/rsnapshot line 2042.
Use of uninitialized value $src in pattern match (m//) at /bin/rsnapshot line 3971.
Use of uninitialized value $src in concatenation (.) or string at /bin/rsnapshot line 3976.
ERROR: Could not understand LVM source "" in linux_lvm_parseurl()
/usr/bin/logger -p user.err -t rsnapshot[8958] /bin/rsnapshot sync: ERROR: \
    Could not understand LVM source "" in linux_lvm_parseurl() 
Use of uninitialized value $traps{"linux_lvm_mountpoint"} in numeric eq (==) at /bin/rsnapshot line 2036.
rm -f /var/run/rsnapshot.pid

Comment 4 James Hogarth 2016-10-27 12:29:54 UTC
I'm really struggling to reproduce this ... can you try my reduced test config on that system and/or try and replicate this on another system with the steps you took to do so?

Comment 5 eduardo.perezesteban 2016-10-27 21:10:22 UTC
According to this bug report on the Debian list, the bug is reproduced only when there is a non-LVM entry after a LVM entry. I just moved the LVM entry to the end of the list of backups, and now "rsnapshot sync" ended without a issue.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=794046

Comment 6 James Hogarth 2016-10-27 21:36:10 UTC
Thanks for finding that - I've lodged the bug upstream to track it there, and will check the debian maintainer's patch as well for a future fix here.

Comment 7 Fedora Update System 2016-12-20 09:32:36 UTC
rsnapshot-1.4.2-2.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-af0b50cdcb

Comment 8 Fedora Update System 2016-12-20 09:32:42 UTC
rsnapshot-1.4.2-2.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-cca4e23413

Comment 9 Fedora Update System 2016-12-20 19:21:15 UTC
rsnapshot-1.4.2-2.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-af0b50cdcb

Comment 10 Fedora Update System 2016-12-20 19:22:01 UTC
rsnapshot-1.4.2-2.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-cca4e23413

Comment 11 eduardo.perezesteban 2016-12-21 22:26:05 UTC
Just tested rsnapshot-1.4.2-2.fc24 from updates-testing, putting the LVM before all the non-LVM entries, and it worked perfectly; many thanks!

Comment 12 Fedora Update System 2016-12-28 20:20:51 UTC
rsnapshot-1.4.2-2.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2016-12-28 21:49:18 UTC
rsnapshot-1.4.2-2.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.