Bug 1533990

Summary: Cannot restore backup when BACKUP_INTEGRITY_CHECK=1 [rhel-7.4.z]
Product: Red Hat Enterprise Linux 7 Reporter: Oneata Mircea Teodor <toneata>
Component: rearAssignee: Pavel Cahyna <pcahyna>
Status: CLOSED ERRATA QA Contact: Tereza Cerna <tcerna>
Severity: medium Docs Contact:
Priority: urgent    
Version: 7.4CC: fkrska, igkioka, jmazanek, jzeleny, ovasik, pcahyna, rmetrich, tcerna, toneata
Target Milestone: rcKeywords: EasyFix, Patch, Reproducer, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rear-2.00-4.el7_4 Doc Type: Bug Fix
Doc Text:
Previously, when using backup integrity checking (BACKUP_INTEGRITY_CHECK=1), the recovery process always failed because the "md5sum" command was not finding the backup archive. This bug has been fixed, and the described problem no longer occurs.
Story Points: ---
Clone Of: 1532676 Environment:
Last Closed: 2018-01-25 12:32:09 UTC Type: ---
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: 1532676    
Bug Blocks:    

Description Oneata Mircea Teodor 2018-01-12 17:38:33 UTC
This bug has been copied from bug #1532676 and has been proposed to be backported to 7.4 z-stream (EUS).

Comment 5 Tereza Cerna 2018-01-16 12:20:44 UTC
=========================
Verified in:
    rear-2.00-4.el7_4
    on x86_64 and ppc64le
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-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.jPXxG0aMZCaWbtA/outputfs/hp-sl2x160zg6-01/backup.tar.gz (compressed)
Checking integrity of backup.tar.gz
/tmp/rear.jPXxG0aMZCaWbtA/outputfs/hp-sl2x160zg6-01 ~
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 LVM PV /dev/sda2
  0 logical volume(s) in volume group "rhel_hp-sl2x160zg6-01" now active
Restoring LVM VG rhel_hp-sl2x160zg6-01
Sleeping 3 seconds to let udev or systemd-udevd create their devices...
Creating filesystem of type xfs with mount point / on /dev/mapper/rhel_hp--sl2x160zg6--01-root.
/dev/mapper/rhel_hp--sl2x160zg6--01-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_hp--sl2x160zg6--01-home.
/dev/mapper/rhel_hp--sl2x160zg6--01-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_hp--sl2x160zg6--01-swap
Disk layout created.
Restoring from '/tmp/rear.jPXxG0aMZCaWbtA/outputfs/hp-sl2x160zg6-01/backup.tar.gz'...
Restoring boot/rear-initrd.cgz OK
Restored 2422 MiB in 53 seconds [avg. 46794 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
    on x86_64 and ppc64le
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 8 errata-xmlrpc 2018-01-25 12:32:09 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:0168