Bug 1865697

Summary: rear shows misleading "socket ignored" information when tar end with exit code > 0
Product: Red Hat Enterprise Linux 7 Reporter: Carlos Santos <casantos>
Component: rearAssignee: Pavel Cahyna <pcahyna>
Status: CLOSED WONTFIX QA Contact: CS System Management SST QE <rhel-cs-system-management-subsystem-qe>
Severity: low Docs Contact:
Priority: unspecified    
Version: 7.8CC: pcahyna, vdolezal
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-11 21:40:13 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:

Description Carlos Santos 2020-08-03 21:55:38 UTC
Description of problem:

When tar exits with status greater than zero, rear copies the last 3 messages
from the backup.log to its own log. They may also be shown to the user if rear
is invoked with the "-v" option.

If the last 3 or more messages from tar are "socket ignored" (informational)
the actual error message (e.g. "file changed as we read it").

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

rear-2.4-11.el7.x86_64

How reproducible:

Frequently

Steps to Reproduce:

1. Set-up /etc/rear/local.conf to save backups in a local filesystem, e.g.

BACKUP=NETFS
BACKUP_URL=file:///backup/
# remove /usr to speed-up the backup
BACKUP_PROG_EXCLUDE=("${BACKUP_PROG_EXCLUDE[@]}" '/usr' '/var/crash' '/var/tmp' '/dev' '/dev/shm' '/run' '/sys/fs/cgroup')

2. Ensure that a daemon that creates sockets is running (e.g. postfix)

   # yum install -y postfix
   # systemctl enable --now postfix

3. Make a backup of /etc/grub.d/README

   # mv /etc/grub.d/README /etc/grub.d/README~
   # cp -p /etc/grub.d/README~ /etc/grub.d/README

4. Run "rear -v mkbackup" while executing a command in parallel to append data
   to /etc/grub.d/README

   # ( while :; do echo .; done ) >> /etc/grub.d/README

5. Stop appending data to /etc/grub.d/README

Actual results:

# rear -v mkbackup
Relax-and-Recover 2.4 / Git
Using log file: /var/log/rear/rear-rhel-7-1.log
Using backup archive '/backup//rhel-7-1/backup.tar.gz'
Using UEFI Boot Loader for Linux (USING_UEFI_BOOTLOADER=1)
Creating disk layout
Excluding component fs:/backup
Using guessed bootloader 'EFI' (found in first bytes on /dev/vda)
Creating root filesystem layout
Trying to find what to use as UEFI bootloader...
Trying to find a 'well known file' to be used as UEFI bootloader...
Using '/boot/efi/EFI/redhat/grubx64.efi' as UEFI bootloader file
Copying logfile /var/log/rear/rear-rhel-7-1.log into initramfs as '/tmp/rear-rhel-7-1-partial-2020-08-03T15:28:45-0300.log'
Copying files and directories
Copying binaries and libraries
Copying kernel modules
Copying all files in /lib*/firmware/
Creating recovery/rescue system initramfs/initrd initrd.cgz with gzip default compression
Created initrd.cgz with gzip default compression (258832181 bytes) in 32 seconds
Making ISO image
Wrote ISO image: /var/lib/rear/output/rear-rhel-7-1.iso (291M)
Copying resulting files to file location
Saving /var/log/rear/rear-rhel-7-1.log as rear-rhel-7-1.log to file location
Creating tar archive '/backup//rhel-7-1/backup.tar.gz'
Archived 568 MiB [avg 10402 KiB/sec] OK
WARNING: tar ended with return code 1 and below output:
  ---snip---
  tar: /var/spool/postfix/public/qmgr: socket ignored
  tar: /var/spool/postfix/public/flush: socket ignored
  tar: /var/spool/postfix/public/showq: socket ignored
  ----------
This means that files have been modified during the archiving
process. As a result the backup may not be completely consistent
or may not be a perfect copy of the system. Relax-and-Recover
will continue, however it is highly advisable to verify the
backup in order to be sure to safely recover this system.

Archived 568 MiB in 57 seconds [avg 10220 KiB/sec]
Exiting rear mkbackup (PID 23976) and its descendant processes
Running exit tasks
(reverse-i-search)`.con': vim -O /etc/rear/local^Conf /usr/share/rear/backup/NETFS/default/500_make_backup.sh

Expected results:

  ---snip---
  tar: /etc/grub.d/README: file changed as we read it
  ----------

Additional info:

The output is generated in line 235 of

    /usr/share/rear/backup/NETFS/default/500_make_backup.sh:

    $(grep '^tar: ' "${TMP_DIR}/${BACKUP_PROG_ARCHIVE}.log" | sed -e 's/^/  /' | tail -n3)

Rear not only hides the real problem but also shows misleading information,
since ignored sockets are not a problem.

Comment 2 Carlos Santos 2020-08-04 11:44:12 UTC
Pull request submitted: https://github.com/rear/rear/pull/2466

Comment 4 Chris Williams 2020-11-11 21:40:13 UTC
Red Hat Enterprise Linux 7 shipped it's final minor release on September 29th, 2020. 7.9 was the last minor releases scheduled for RHEL 7.
From intial triage it does not appear the remaining Bugzillas meet the inclusion criteria for Maintenance Phase 2 and will now be closed. 

From the RHEL life cycle page:
https://access.redhat.com/support/policy/updates/errata#Maintenance_Support_2_Phase
"During Maintenance Support 2 Phase for Red Hat Enterprise Linux version 7,Red Hat defined Critical and Important impact Security Advisories (RHSAs) and selected (at Red Hat discretion) Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available."

If this BZ was closed in error and meets the above criteria please re-open it flag for 7.9.z, provide suitable business and technical justifications, and follow the process for Accelerated Fixes:
https://source.redhat.com/groups/public/pnt-cxno/pnt_customer_experience_and_operations_wiki/support_delivery_accelerated_fix_release_handbook  

Feature Requests can re-opened and moved to RHEL 8 if the desired functionality is not already present in the product. 

Please reach out to the applicable Product Experience Engineer[0] if you have any questions or concerns.  

[0] https://bugzilla.redhat.com/page.cgi?id=agile_component_mapping.html&product=Red+Hat+Enterprise+Linux+7