Bug 1532676

Summary: Cannot restore backup when BACKUP_INTEGRITY_CHECK=1
Product: Red Hat Enterprise Linux 7 Reporter: Renaud Métrich <rmetrich>
Component: rearAssignee: Pavel Cahyna <pcahyna>
Status: CLOSED ERRATA QA Contact: Tereza Cerna <tcerna>
Severity: medium Docs Contact: Petr Bokoc <pbokoc>
Priority: urgent    
Version: 7.4CC: fkrska, igkioka, jmazanek, jzeleny, ovasik, pbokoc, pcahyna, tcerna, toneata
Target Milestone: rcKeywords: EasyFix, Patch, Reproducer, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rear-2.00-5.el7 Doc Type: Bug Fix
Doc Text:
*ReaR* recovery no longer fails when backup integrity checking is enabled Previously, if *ReaR* (Relax-and-Recover) was configured to use backup integrity checking (`BACKUP_INTEGRITY_CHECK=1`), the recovery process always failed because the "md5sum" command could not find the backup archive. This bug has been fixed, and the described problem no longer occurs.
Story Points: ---
Clone Of:
: 1533990 (view as bug list) Environment:
Last Closed: 2018-04-10 18:43:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1533990    

Description Renaud Métrich 2018-01-09 14:56:38 UTC
Description of problem:

When using BACKUP_INTEGRITY_CHECK=1, recovery fails with the following error, trying to compute the md5sum of the backup:

Checking integrity of backup.tar.gz
backup.tar.gz: FAILED open or read
ERROR: Integrity check failed. Restore aborted because BACKUP_INTEGRITY_CHECK is enabled.
Aborting due to an error, check /var/log/rear/rear-vm-rear74.log for details
Terminated

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

rear-2.00-3.el7_4.x86_64


How reproducible:

Always


Additional infos:

UPSTREAM PR: https://github.com/rear/rear/pull/1686

Comment 7 Tereza Cerna 2018-01-19 09:37:32 UTC
=========================
Verified in:
    rear-2.00-5.el7
PASS
=========================

# cat /etc/rear/local.conf 
OUTPUT=ISO
BACKUP=NETFS
BACKUP_URL=nfs://10.8.244.200/mnt/rear/
GRUB_RESCUE=1
BACKUP_INTEGRITY_CHECK=1

# rear -v mkbackup
# reboot (to relax and recover mode)

# rear recover
Relax-and-Recover 2.00 / Git
Using log file: /var/log/rear/rear-metrique-dev-02.log
Running workflow recover within the ReaR rescue/recovery system
Starting required daemons for NFS: RPC portmapper (portmap or rpcbind) and rpc.statd if available.
Started RPC portmapper 'rpcbind'.
RPC portmapper 'rpcbind' available.
Started rpc.statd.
RPC status rpc.statd available.
Started rpc.idmapd.
Using backup archive 'backup.tar.gz'
Calculating backup archive size
Backup archive size is 1.1G	/tmp/rear.JiPOjycfZQt8fEx/outputfs/metrique-dev-02/backup.tar.gz (compressed)
Checking integrity of backup.tar.gz
/tmp/rear.JiPOjycfZQt8fEx/outputfs/metrique-dev-02 ~
backup.tar.gz: OK
~
Comparing disks.
Disk configuration is identical, proceeding with restore.
Start system layout restoration.
Creating partitions for disk /dev/sda (msdos)
Creating partitions for disk /dev/sdb (msdos)
Creating LVM PV /dev/sda2
  0 logical volume(s) in volume group "rhel_metrique-dev-02" now active
Creating LVM PV /dev/sdb1
  0 logical volume(s) in volume group "rhel_metrique-dev-02" now active
Restoring LVM VG rhel_metrique-dev-02
Sleeping 3 seconds to let udev or systemd-udevd create their devices...
Creating filesystem of type xfs with mount point / on /dev/mapper/rhel_metrique--dev--02-root.
/dev/mapper/rhel_metrique--dev--02-root: 4 bytes were erased at offset 0x00000000 (xfs): 58 46 53 42
Mounting filesystem /
Creating filesystem of type xfs with mount point /home on /dev/mapper/rhel_metrique--dev--02-home.
/dev/mapper/rhel_metrique--dev--02-home: 4 bytes were erased at offset 0x00000000 (xfs): 58 46 53 42
Mounting filesystem /home
Creating filesystem of type xfs with mount point /boot on /dev/sda1.
/dev/sda1: 4 bytes were erased at offset 0x00000000 (xfs): 58 46 53 42
Mounting filesystem /boot
Creating swap on /dev/mapper/rhel_metrique--dev--02-swap
Disk layout created.
Restoring from '/tmp/rear.JiPOjycfZQt8fEx/outputfs/metrique-dev-02/backup.tar.gz'...
Restoring var/log/rear/rear-metrique-dev-02.log OK
Restored 2564 MiB in 69 seconds [avg. 38061 KiB/sec]
Restoring finished.
Restore the Mountpoints (with permissions) from /var/lib/rear/recovery/mountpoint_permissions
Skip installing GRUB Legacy boot loader because GRUB 2 is installed (grub-probe or grub2-probe exist).
Installing GRUB2 boot loader
Finished recovering your system. You can explore it under '/mnt/local'.

>> Recover finish successfully.

=========================
Reproduced in:
    rear-2.00-3.el7_4
FAIL
=========================

# cat /etc/rear/local.conf 
OUTPUT=ISO
BACKUP=NETFS
BACKUP_URL=nfs://10.8.244.200/mnt/rear/
GRUB_RESCUE=1
BACKUP_INTEGRITY_CHECK=1

# rear -v mkbackup
# reboot (to relax and recover mode)

# rear recover
Relax-and-Recover 2.00 / Git
Using log file: /var/log/rear/rear-hp-sl2x160zg6-01.log
Running workflow recover within the ReaR rescue/recovery system
Starting required daemons for NFS: RPC portmapper (portmap or rpcbind) and rpc.statd if available.
Started RPC portmapper 'rpcbind'.
RPC portmapper 'rpcbind' available.
Started rpc.statd.
RPC status rpc.statd available.
Started rpc.idmapd.
Using backup archive 'backup.tar.gz'
Calculating backup archive size
Backup archive size is 1.1G	/tmp/rear.uth86wn9MozWaCO/outputfs/hp-sl2x160zg6-01/backup.tar.gz (compressed)
Checking integrity of backup.tar.gz
backup.tar.gz: FAILED open or read                                                          !!!
ERROR: Integrity check failed. Restore aborted because BACKUP_INTEGRITY_CHECK is enabled.   !!!
Aborting due to an error, check /var/log/rear/rear-hp-sl2x160zg6-01.log for details          
Terminated

>> Error message is visible:
>>   backup.tar.gz: FAILED open or read
>>   ERROR: Integrity check failed. Restore aborted because BACKUP_INTEGRITY_CHECK is enabled.

Comment 10 errata-xmlrpc 2018-04-10 18:43:20 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:1000