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

rear shows misleading "socket ignored" information when tar end with exit code 1 #2465

Closed
casantos opened this issue Aug 3, 2020 · 2 comments
Assignees
Labels
enhancement Adaptions and new features fixed / solved / done
Milestone

Comments

@casantos
Copy link
Contributor

casantos commented Aug 3, 2020

  • ReaR version ("/usr/sbin/rear -V"): Relax-and-Recover 2.4 / Git

  • OS version ("cat /etc/os-release" or "lsb_release -a" or "cat /etc/rear/os.conf"): Red Hat Enterprise Linux Server release 7.8 (Maipo)

  • ReaR configuration files ("cat /etc/rear/site.conf" and/or "cat /etc/rear/local.conf"):

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')
  • Hardware (PC or PowerNV BareMetal or ARM) or virtual machine (KVM guest or PoverVM LPAR): KVM guest.

  • System architecture (x86 compatible or PPC64/PPC64LE or what exact ARM device): x86_64

  • Firmware (BIOS or UEFI or Open Firmware) and bootloader (GRUB or ELILO or Petitboot): UEFI

  • Storage (local disk or SSD) and/or SAN (FC or iSCSI or FCoE) and/or multipath (DM or NVMe): VirtIO disks

  • Storage layout ("lsblk -ipo NAME,KNAME,PKNAME,TRAN,TYPE,FSTYPE,SIZE,MOUNTPOINT" or "lsblk" as makeshift):

NAME                                 KNAME     PKNAME    TRAN   TYPE FSTYPE       SIZE MOUNTPOINT
/dev/sr0                             /dev/sr0            sata   rom  iso9660      4.2G 
/dev/vda                             /dev/vda                   disk               20G 
|-/dev/vda1                          /dev/vda1 /dev/vda         part vfat         200M /boot/efi
|-/dev/vda2                          /dev/vda2 /dev/vda         part xfs            1G /boot
`-/dev/vda3                          /dev/vda3 /dev/vda         part LVM2_member 18.8G 
  |-/dev/mapper/rhel_rhel--7--1-root /dev/dm-0 /dev/vda3        lvm  xfs         16.8G /
  `-/dev/mapper/rhel_rhel--7--1-swap /dev/dm-1 /dev/vda3        lvm  swap           2G [SWAP]
/dev/vdb                             /dev/vdb                   disk               20G 
`-/dev/vdb1                          /dev/vdb1 /dev/vdb         part xfs           20G /backup
  • Description of the issue (ideally so that others can reproduce it):

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").

  • Workaround, if any: none

  • Attachments, as applicable ("rear -D mkrescue/mkbackup/recover" debug log files): N.A.

  • 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')
  1. Ensure that a daemon that creates sockets is running (e.g. postfix)
# yum install -y postfix
# systemctl enable --now postfix
  1. 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
  1. 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
  1. 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.

casantos added a commit to casantos/rear that referenced this issue Aug 4, 2020
When tar exits with status greater than zero rear copies the last three
tar messages from backup.log to its own log. Those lines are also shown
to the user when rear is invoked with the "-v" option.

Some tar messages, however, are purely informational, e.g.

    tar: Removing leading `/' from member names
    tar: Removing leading `/' from hard link targets
    tar: /var/spool/postfix/private/discard: socket ignored

Strip the informational messages and show only actual errors, e.g.

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

Fixes: issue rear#2465
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1865697

Signed-off-by: Carlos Santos <casantos@redhat.com>
@jsmeix jsmeix self-assigned this Aug 4, 2020
@jsmeix jsmeix added the enhancement Adaptions and new features label Aug 4, 2020
@jsmeix jsmeix added this to the ReaR v2.7 milestone Aug 4, 2020
@jsmeix jsmeix changed the title rear shows misleading "socket ignored" information when tar end with exit code > 0 rear shows misleading "socket ignored" information when tar end with exit code 1 Aug 4, 2020
casantos added a commit to casantos/rear that referenced this issue Aug 4, 2020
When tar exits with status greater than zero rear copies the last three
tar messages from backup.log to its own log. Those lines are also shown
to the user when rear is invoked with the "-v" option.

Some tar messages, however, are purely informational, e.g.

    tar: Removing leading `/' from member names
    tar: Removing leading `/' from hard link targets
    tar: /var/spool/postfix/private/discard: socket ignored

Strip the informational messages and show only actual errors, e.g.

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

Fixes: issue rear#2465
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1865697

Signed-off-by: Carlos Santos <casantos@redhat.com>
jsmeix added a commit that referenced this issue Aug 5, 2020
In 500_make_backup.sh fixed what I did wrong in
2674807
where I had removed the BACKUP_PROG_CRYPT_OPTIONS="cat"
which breaks the exit code logic around pipes_rc=( ${PIPESTATUS[@]} )
because backup_prog_shortnames does no longer match.
Additionally filter informational tar messages from output
cf. #2465
casantos added a commit to casantos/rear that referenced this issue Aug 6, 2020
When tar exits with status greater than zero rear copies the last three
tar messages from backup.log to its own log. Those lines are also shown
to the user when rear is invoked with the "-v" option.

Some tar messages, however, are purely informational, e.g.

    tar: Removing leading `/' from member names
    tar: Removing leading `/' from hard link targets
    tar: /var/spool/postfix/private/discard: socket ignored

Strip the informational messages and show only actual errors, e.g.

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

Fixes: issue rear#2465
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1865697

Signed-off-by: Carlos Santos <casantos@redhat.com>
@jsmeix
Copy link
Member

jsmeix commented Aug 7, 2020

With #2466 merged this issue is done.

@casantos
thank you for your contribution to ReaR!

@jsmeix jsmeix closed this as completed Aug 7, 2020
@robertdahlem
Copy link
Contributor

While at it: please filter out "Broken symlink" too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adaptions and new features fixed / solved / done
Projects
None yet
Development

No branches or pull requests

3 participants