#2686 Issue closed: sbin/rear silently ignores when "Source CONFIG_FILE" fails

Labels: enhancement, fixed / solved / done

dcz01 opened issue at 2021-09-29 15:32:

ERROR: BACKUP=NETFS requires a BACKUP_URL backup target location

Fill in the following items before submitting a new issue
(quick response is not guaranteed with free support):

  • ReaR version ("/usr/sbin/rear -V"):
    Relax-and-Recover 2.6 / Git
    rear-2.6.5-1.el8.x86_64

  • OS version ("cat /etc/os-release" or "lsb_release -a" or "cat /etc/rear/os.conf"):

NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
  • ReaR configuration files ("cat /etc/rear/site.conf" and/or "cat /etc/rear/local.conf"):
OUTPUT=ISO
OUTPUT_URL=file:///tmp/rear
BACKUP=NETFS
#BACKUP=TSM
BACKUP_PROG=tar
BACKUP_PROG_CRYPT_ENABLED=1
BACKUP_PROG_CRYPT_KEY=<Verschluesselungskennwort>
BACKUP_PROG_CRYPT_OPTIONS="/usr/bin/openssl aes-256-cbc -salt -k"
BACKUP_PROG_DECRYPT_OPTIONS="/usr/bin/openssl aes-256-cbc -d -k"
#BACKUP_URL=nfs://<IP-Adresse oder DNS-Name>/<Freigabepfad>
#BACKUP_URL=cifs://<Server>/<Freigabe>
BACKUP_URL=usb:///dev/disk/by-label/REAR-000
#BACKUP_OPTIONS="cred=/etc/rear/cifs,sec=ntlmsspi"
#BACKUP_OPTIONS="nfsvers=4,nolock"
BACKUP_TYPE=incremental
FULLBACKUPDAY="Sat"
BACKUP_PROG_EXCLUDE=( '/tmp/*' '/dev/shm/*' $VAR_DIR/output/\* '/opt/tivoli/tsm/rear/*' '/mnt/*' '/media/*' '/var/lib/pgsql/*/data/base/*' '/var/lib/pgsql/*/data/global/*' '/var/lib/pgsql/*/data/pg*/*' )
SSH_ROOT_PASSWORD='$6$CFQoHxuu57fA8oWc$RCLWE/ZiSlKFAjNADp6ob.feRYxy/zk1Hch/QK9awCMhtTwPmEdddza/w5WlpnK85pcCVhh/MJ4evHTg73sl//'
#BOOTLOADER="GRUB2-EFI"
USB_SUFFIX="$HOSTNAME"
USB_DEVICE_PARTED_LABEL=gpt
USB_DEVICE_FILESYSTEM=ext4
  • Hardware vendor/product (PC or PowerNV BareMetal or ARM) or VM (KVM guest or PowerVM LPAR):
    PC, Server: Fujitsu Primergy TX150 S7

  • 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):
    BIOS with GRUB2

  • Storage (local disk or SSD) and/or SAN (FC or iSCSI or FCoE) and/or multipath (DM or NVMe):
    Local Storage on HDD with RAID

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

NAME        KNAME     PKNAME   TRAN   TYPE FSTYPE   SIZE MOUNTPOINT
/dev/sda    /dev/sda                  disk        463,8G
|-/dev/sda1 /dev/sda1 /dev/sda        part            1M
|-/dev/sda2 /dev/sda2 /dev/sda        part xfs      500M /boot
|-/dev/sda3 /dev/sda3 /dev/sda        part xfs     97,7G /
|-/dev/sda4 /dev/sda4 /dev/sda        part swap     7,9G [SWAP]
|-/dev/sda5 /dev/sda5 /dev/sda        part vfat     200M /boot/efi
`-/dev/sda6 /dev/sda6 /dev/sda        part xfs    357,6G /var/lib/pgsql
/dev/sdb    /dev/sdb           usb    disk        114,6G
|-/dev/sdb1 /dev/sdb1 /dev/sdb        part vfat       2G
`-/dev/sdb2 /dev/sdb2 /dev/sdb        part ext4   112,6G
/dev/sdc    /dev/sdc           usb    disk        931,5G
`-/dev/sdc1 /dev/sdc1 /dev/sdc        part ext4   931,5G
/dev/sr0    /dev/sr0           sata   rom          1024M

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 463,8G  0 disk
├─sda1   8:1    0     1M  0 part
├─sda2   8:2    0   500M  0 part /boot
├─sda3   8:3    0  97,7G  0 part /
├─sda4   8:4    0   7,9G  0 part [SWAP]
├─sda5   8:5    0   200M  0 part /boot/efi
└─sda6   8:6    0 357,6G  0 part /var/lib/pgsql
sdb      8:16   1 114,6G  0 disk
├─sdb1   8:17   1     2G  0 part
└─sdb2   8:18   1 112,6G  0 part
sdc      8:32   0 931,5G  0 disk
└─sdc1   8:33   0 931,5G  0 part /tmp/mnt
sr0     11:0    1  1024M  0 rom
  • Description of the issue (ideally so that others can reproduce it):
[root@FBD097TL ~]# rear mkrescue -D
Relax-and-Recover 2.6 / Git
Running rear mkrescue (PID 29947 date 2021-09-29 10:52:28)
Command line options: /usr/sbin/rear mkrescue -D
Using log file: /var/log/rear/rear-FBD097TL.log
Using build area: /tmp/rear.V8jUiKpFMXXw9FF
Running workflow mkrescue on the normal/original system
ERROR: BACKUP=NETFS requires a BACKUP_URL backup target location
Some latest log messages since the last called script 040_check_backup_and_output_scheme.sh:
  2021-09-29 10:52:29.193730702 Entering debugscript mode via 'set -x'.
Aborting due to an error, check /var/log/rear/rear-FBD097TL.log for details
Exiting rear mkrescue (PID 29947) and its descendant processes ...
Running exit tasks
To remove the build area use (with caution): rm -Rf --one-file-system /tmp/rear.V8jUiKpFMXXw9FF
Beendet
  • Workaround, if any:
    None

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

jsmeix commented at 2021-10-01 08:38:

@dcz01
your https://github.com/rear/rear/files/7253188/rear-FBD097TL.log
does not contain any setting of BACKUP_URL
in particular your log contains (excerpts)

2021-09-29 10:52:28.918505396 Including /etc/rear/site.conf
2021-09-29 10:52:28.921580924 Entering debugscript mode via 'set -x'.
+ source /etc/rear/site.conf
++ OUTPUT=ISO
++ OUTPUT_URL=file:///tmp/rear
++ BACKUP=NETFS
++ BACKUP_PROG=tar
++ BACKUP_PROG_CRYPT_ENABLED=1
/etc/rear/site.conf: line 7: syntax error near unexpected token `newline'
/etc/rear/site.conf: line 7: `BACKUP_PROG_CRYPT_KEY=<Verschluesselungskennwort>'
+ source_return_code=1

...

2021-09-29 10:52:28.937207669 Including /etc/rear/local.conf
2021-09-29 10:52:28.940558375 Entering debugscript mode via 'set -x'.
+ source /etc/rear/local.conf
+ source_return_code=0

so ReaR was right to error out.

I think I will improve usr/sbin/rear
to show an explicit error message to the user
when Source CONFIG_FILE does not succeed.

jsmeix commented at 2021-10-01 09:45:

https://github.com/rear/rear/pull/2689
intends to makes it obvious to the user
when there are syntax errors in his config files

jsmeix commented at 2021-10-01 12:47:

With https://github.com/rear/rear/pull/2689 merged
the root cause of what is described here in the initial posting
https://github.com/rear/rear/issues/2686#issue-1011113094
should be fixed because now it is obvious in particular
when there are pure bash syntax errors in user config files but
there is no test if the settings in user config files are syntactically right.


[Export of Github issue for rear/rear.]