What were you trying to do that didn't work?
================================================
I was to testing ReaR with an intentional syntax error in /etc/rear/local.conf to verify behavior.
On RHEL 9, even though a syntax error was logged, ReaR proceeded with the mkbackup workflow, which is not expected behavior. The same test on RHEL 10 correctly failed, indicating missing validation logic in ReaR on RHEL 9.
What is the impact of this issue to you?
================================================
1] Risk of running backup with an incomplete or misconfigured environment
2] Inconsistent behavior across OS versions
Please provide the package NVR for which the bug is seen:
================================================
rear-2.6-26.el9.x86_64
How reproducible is this bug?:
================================================
100% reproducible
Steps to reproduce
================================================
1] On a RHEL 9 system with ReaR installed, create a syntax error in /etc/rear/local.conf
# cat /etc/rear/local.conf OUTPUT=ISO OUTPUT_URL=file:///rear BACKUP=NETFS BACKUP_URL=file:///rear/ BACKUP_PROG_EXCLUDE=("${BACKUP_PROG_EXCLUDE[@]}" '/media' '/var/tmp '/var/crash' )
The syntax error is the closing quote is missing around /var/tmp
2] Run: rear -d -v mkbackup
3] Check the logs at /var/log/rear/rear-<hostname>.log.
Observe that a syntax error is logged:
/etc/rear/local.conf: line 23: unexpected EOF while looking for matching `'' /etc/rear/local.conf: line 24: syntax error: unexpected end of file 2025-07-17 12:06:38.502330577 Source function: 'source /etc/rear/local.conf' returns 1
But the workflow proceeds and backup starts.
[root@rhel9 tmp]# rear -d -v mkbackup Relax-and-Recover 2.6 / 2020-06-17 Running rear mkbackup (PID 2896) Using log file: /var/log/rear/rear-rhel9.log Running workflow mkbackup on the normal/original system Using backup archive '/rear//rhel9/backup.tar.gz' ERROR: URL 'file:///rear/' has the backup directory '/rear/' in the '/' filesystem which is forbidden. Some latest log messages since the last called script 400_automatic_exclude_recreate.sh: 2025-07-17 21:33:58.550563890 Including prep/NETFS/default/400_automatic_exclude_recreate.sh Aborting due to an error, check /var/log/rear/rear-rhel9.log for details Exiting rear mkbackup (PID 2896) and its descendant processes ... Running exit tasks You should also rm -Rf --one-file-system /var/tmp/rear.hRuityyQSLPXIIr Terminated [root@rhel9 tmp]# cat /var/log/rear/rear-rhel9.log 2025-07-17 21:38:38.147782353 Relax-and-Recover 2.6 / 2020-06-17 2025-07-17 21:38:38.149013346 Running rear mkbackup (PID 3363) 2025-07-17 21:38:38.150217031 Command line options: /usr/sbin/rear -d -v mkbackup 2025-07-17 21:38:38.151248882 Using log file: /var/log/rear/rear-rhel9.log 2025-07-17 21:38:38.152562029 Current set of flags is 'hB' 2025-07-17 21:38:38.153656972 The debugscripts flags are 'x' 2025-07-17 21:38:38.154776516 Combining configuration files 2025-07-17 21:38:38.155890587 Including /etc/rear/os.conf 2025-07-17 21:38:38.158634064 Including conf/Linux-i386.conf 2025-07-17 21:38:38.159896075 Including conf/GNU/Linux.conf 2025-07-17 21:38:38.168056933 Including /etc/rear/local.conf /etc/rear/local.conf: line 23: unexpected EOF while looking for matching `'' /etc/rear/local.conf: line 24: syntax error: unexpected end of file 2025-07-17 21:38:38.169432391 Source function: 'source /etc/rear/local.conf' returns 1 2025-07-17 21:38:38.171436766 ====================== 2025-07-17 21:38:38.172457466 Running 'init' stage 2025-07-17 21:38:38.173483696 ====================== 2025-07-17 21:38:38.183264338 Including init/default/005_verify_os_conf.sh 2025-07-17 21:38:38.186328971 Including init/default/010_EFISTUB_check.sh 2025-07-17 21:38:38.191994123 Including init/default/010_set_drlm_env.sh 2025-07-17 21:38:38.199428719 Including init/default/030_update_recovery_system.sh 2025-07-17 21:38:38.205580512 Including init/default/050_check_rear_recover_mode.sh 2025-07-17 21:38:38.207540413 Running workflow mkbackup on the normal/original system 2025-07-17 21:38:38.213767904 Including init/default/950_check_missing_programs.sh 2025-07-17 21:38:38.221256861 Finished running 'init' stage in 0 seconds 2025-07-17 21:38:38.230843091 Using build area '/var/tmp/rear.PAXoLwiIhMp2Io3' mkdir: created directory '/var/tmp/rear.PAXoLwiIhMp2Io3/rootfs' mkdir: created directory '/var/tmp/rear.PAXoLwiIhMp2Io3/tmp' 2025-07-17 21:38:38.236765071 Running mkbackup workflow 2025-07-17 21:38:38.240122147 ====================== 2025-07-17 21:38:38.241221051 Running 'prep' stage 2025-07-17 21:38:38.242323206 ====================== 2025-07-17 21:38:38.252421953 Including prep/default/005_remove_workflow_conf.sh mkdir: created directory '/var/tmp/rear.PAXoLwiIhMp2Io3/rootfs/etc' mkdir: created directory '/var/tmp/rear.PAXoLwiIhMp2Io3/rootfs/etc/rear' 2025-07-17 21:38:38.258263468 Including prep/default/020_translate_url.sh 2025-07-17 21:38:38.263503865 Including prep/default/030_translate_tape.sh 2025-07-17 21:38:38.270353535 Including prep/default/035_valid_backup_methods.sh 2025-07-17 21:38:38.274670240 Including prep/default/040_check_backup_and_output_scheme.sh 2025-07-17 21:38:38.281979442 Including prep/NETFS/default/040_inspect_configuration_files.sh 2025-07-17 21:38:38.283087397 Source function: 'source /usr/share/rear/prep/NETFS/default/040_inspect_configuration_files.sh' returns 1 2025-07-17 21:38:38.286074705 Including prep/NETFS/default/050_check_NETFS_requirements.sh 2025-07-17 21:38:38.289884958 Skipping 'ping' test for host '' in BACKUP_URL 'file:///rear/' 2025-07-17 21:38:38.295263596 Including prep/default/050_check_keep_old_output_copy_var.sh 2025-07-17 21:38:38.296415420 Source function: 'source /usr/share/rear/prep/default/050_check_keep_old_output_copy_var.sh' returns 1 2025-07-17 21:38:38.299492845 Including prep/NETFS/default/060_mount_NETFS_path.sh 2025-07-17 21:38:38.304914390 Including prep/NETFS/default/070_set_backup_archive.sh 2025-07-17 21:38:38.309114480 Using backup archive '/rear//rhel9/backup.tar.gz' 2025-07-17 21:38:38.312841886 Including prep/NETFS/default/090_check_encrypted_backup.sh 2025-07-17 21:38:38.316052832 Including prep/NETFS/default/100_check_nfs_version.sh find: '/var/lib/nfs': No such file or directory 2025-07-17 21:38:38.329731601 Including prep/default/100_init_workflow_conf.sh 2025-07-17 21:38:38.335359275 Including prep/NETFS/default/150_save_rsync_version.sh 2025-07-17 21:38:38.341107593 Including prep/GNU/Linux/200_include_getty.sh 2025-07-17 21:38:38.358898145 Source function: 'source /usr/share/rear/prep/GNU/Linux/200_include_getty.sh' returns 1 2025-07-17 21:38:38.362700758 Including prep/GNU/Linux/200_include_serial_console.sh /usr/share/rear/lib/_input-output-functions.sh: line 476: type: getty: not found 2025-07-17 21:38:38.372083560 Including prep/NETFS/GNU/Linux/200_selinux_in_use.sh 2025-07-17 21:38:38.376077434 Including prep/NETFS/GNU/Linux/205_inspect_tar_capabilities.sh 2025-07-17 21:38:38.386784414 Including prep/GNU/Linux/210_include_dhclient.sh 2025-07-17 21:38:38.423469037 Detected an active Network Manager connection 'enp1s0' set up via DHCPv4 2025-07-17 21:38:38.424671485 Auto-enabling DHCP on the rescue system /usr/share/rear/lib/_input-output-functions.sh: line 476: type: dhcpcd: not found 2025-07-17 21:38:38.429001320 Including prep/GNU/Linux/220_include_lvm_tools.sh 2025-07-17 21:38:38.430732968 Device mapper found enabled. Including LVM tools. File descriptor 6 (/dev/pts/0) leaked on lvs invocation. Parent PID 3363: /usr/bin/bash File descriptor 7 (/dev/pts/0) leaked on lvs invocation. Parent PID 3363: /usr/bin/bash File descriptor 8 (/dev/pts/0) leaked on lvs invocation. Parent PID 3363: /usr/bin/bash File descriptor 6 (/dev/pts/0) leaked on lvs invocation. Parent PID 3363: /usr/bin/bash File descriptor 7 (/dev/pts/0) leaked on lvs invocation. Parent PID 3363: /usr/bin/bash File descriptor 8 (/dev/pts/0) leaked on lvs invocation. Parent PID 3363: /usr/bin/bash 2025-07-17 21:38:38.478127962 Including prep/GNU/Linux/230_include_md_tools.sh 2025-07-17 21:38:38.482285900 Including prep/GNU/Linux/240_include_multipath_tools.sh 2025-07-17 21:38:38.485446320 Including prep/GNU/Linux/280_include_systemd.sh 2025-07-17 21:38:38.493964116 Including systemd (init replacement) tool-set to bootstrap Relax-and-Recover 2025-07-17 21:38:38.497240252 Including prep/GNU/Linux/280_include_virtualbox.sh 2025-07-17 21:38:38.503884100 Including prep/GNU/Linux/280_include_vmware_tools.sh 2025-07-17 21:38:38.511795694 Including prep/GNU/Linux/290_include_drbd.sh 2025-07-17 21:38:38.518629112 Including prep/GNU/Linux/300_check_backup_and_output_url.sh 2025-07-17 21:38:38.527669323 Including prep/ISO/default/300_check_iso_dir.sh 2025-07-17 21:38:38.530998648 Including prep/GNU/Linux/300_include_grub_tools.sh 2025-07-17 21:38:38.535839396 Including prep/GNU/Linux/310_include_cap_utils.sh 2025-07-17 21:38:38.540281934 Including prep/ISO/default/320_check_cdrom_size.sh 2025-07-17 21:38:38.544054513 ISO Directory '/var/lib/rear/output' [/dev/mapper/rhel-root] has 7913 MB free space 2025-07-17 21:38:38.548572103 Including prep/default/320_include_uefi_env.sh 2025-07-17 21:38:38.555025511 Including prep/ISO/GNU/Linux/320_verify_mkisofs.sh 2025-07-17 21:38:38.559296793 Using '/bin/xorrisofs' to create ISO images 2025-07-17 21:38:38.562758538 Including prep/default/321_EFISTUB_check_uefi_env.sh 2025-07-17 21:38:38.565919528 Including prep/ISO/Linux-i386/330_find_isolinux.sh 2025-07-17 21:38:38.571280587 Including prep/default/330_include_uefi_tools.sh 2025-07-17 21:38:38.574378570 Including prep/ISO/GNU/Linux/340_add_isofs_module.sh 2025-07-17 21:38:38.579543078 Including prep/ISO/GNU/Linux/360_EFISTUB_prechecks.sh 2025-07-17 21:38:38.582752414 Including prep/default/380_include_opal_tools.sh /usr/share/rear/lib/_input-output-functions.sh: line 476: type: sedutil-cli: not found 2025-07-17 21:38:38.586067383 Including prep/NETFS/default/400_automatic_exclude_recreate.sh 2025-07-17 21:38:38.601625233 ERROR: URL 'file:///rear/' has the backup directory '/rear/' in the '/' filesystem which is forbidden. ===== Stack trace ===== Trace 0: /usr/sbin/rear:553 main Trace 1: /usr/share/rear/lib/mkbackup-workflow.sh:9 WORKFLOW_mkbackup Trace 2: /usr/share/rear/lib/framework-functions.sh:116 SourceStage Trace 3: /usr/share/rear/lib/framework-functions.sh:56 Source Trace 4: /usr/share/rear/prep/NETFS/default/400_automatic_exclude_recreate.sh:32 source === End stack trace === 2025-07-17 21:38:38.607804636 Exiting rear mkbackup (PID 3363) and its descendant processes ... 2025-07-17 21:38:41.648955337 rear,3363 /usr/sbin/rear -d -v mkbackup `-rear,3795 /usr/sbin/rear -d -v mkbackup `-pstree,3796 -Aplau 3363 /usr/share/rear/lib/_input-output-functions.sh: line 151: kill: (3799) - No such process 2025-07-17 21:38:41.662315479 Running exit tasks 2025-07-17 21:38:41.663935932 Exit task 'cleanup_build_area_and_end_program' 2025-07-17 21:38:41.665201956 Finished in 3 seconds 2025-07-17 21:38:41.666431964 You should also rm -Rf --one-file-system /var/tmp/rear.PAXoLwiIhMp2Io3 2025-07-17 21:38:41.667795356 End of program reached 2025-07-17 21:38:41.668990250 Exit task '(( EXIT_FAIL_MESSAGE )) && echo 'rear mkbackup failed, check /var/log/rear/rear-rhel9.log for details' 1>&8' 2025-07-17 21:38:41.670153168 Exit task 'exec 8>&-' 2025-07-17 21:38:41.671297895 Exit task 'exec 7>&-' 2025-07-17 21:38:41.672435680 Exit task 'exec 6<&-' 2025-07-17 21:38:41.673554304 Exit task ''
4] Run the same test on a RHEL 10 system with ReaR 2.9 and observe that it fails early, which is the correct behavior.
[root@rhel10 ~]# rear -d -v mkbackup Relax-and-Recover 2.9 / 2025-01-31 Running rear mkbackup (PID 5068 date 2025-07-17 21:34:26) Command line options: /usr/sbin/rear -d -v mkbackup Using log file: /var/log/rear/rear-rhel10.log Using build area: /var/tmp/rear.8YdP1dzbJjynTOe Setting TMPDIR to ReaR's '/var/tmp/rear.8YdP1dzbJjynTOe/tmp' (was unset when ReaR was launched) ERROR: Failed to Source /etc/rear/local.conf You may use debugscript mode '-D' for full debug messages with 'set -x' output Aborting due to an error, check /var/log/rear/rear-rhel10.log for details Exiting rear mkbackup (PID 5068) and its descendant processes ... Running exit tasks To remove the build area you may use (with caution): rm -Rf --one-file-system /var/tmp/rear.8YdP1dzbJjynTOe Terminated # cat /var/log/rear/rear-rhel10.log 2025-07-17 21:39:25.955590934 Relax-and-Recover 2.9 / 2025-01-31 2025-07-17 21:39:25.958402702 Running rear mkbackup (PID 5317 date 2025-07-17 21:39:25) 2025-07-17 21:39:25.961159985 Command line options: /usr/sbin/rear -d -v mkbackup 2025-07-17 21:39:25.963900731 Using log file: /var/log/rear/rear-rhel10.log 2025-07-17 21:39:25.966603804 Using build area: /var/tmp/rear.CM5M5KI3uIoB2V5 2025-07-17 21:39:25.969751791 Setting TMPDIR to ReaR's '/var/tmp/rear.CM5M5KI3uIoB2V5/tmp' (was unset when ReaR was launched) 2025-07-17 21:39:25.973087749 Current set of flags is 'hB' 2025-07-17 21:39:25.976165260 The debugscripts flags are 'x' 2025-07-17 21:39:25.978830277 Combining configuration files 2025-07-17 21:39:25.993124055 Including conf/Linux-i386.conf 2025-07-17 21:39:25.995945567 Including conf/GNU/Linux.conf 2025-07-17 21:39:26.017158905 Including /etc/rear/local.conf /etc/rear/local.conf: line 31: unexpected EOF while looking for matching `'' 2025-07-17 21:39:26.019978306 Source function: 'source /etc/rear/local.conf' returns 1 2025-07-17 21:39:26.029636190 ERROR: Failed to Source /etc/rear/local.conf ===== Stack trace ===== Trace 0: /usr/sbin/rear:757 main === End stack trace === 2025-07-17 21:39:26.036692941 Exiting rear mkbackup (PID 5317) and its descendant processes ... 2025-07-17 21:39:26.049157250 rear,5317 /usr/sbin/rear -d -v mkbackup `-rear,5508 /usr/sbin/rear -d -v mkbackup `-pstree,5509 -Aplau 5317 /usr/share/rear/lib/_input-output-functions.sh: line 151: kill: (5514) - No such process 2025-07-17 21:39:26.066442173 Running exit tasks 2025-07-17 21:39:26.069453587 Exit task 'cleanup_build_area_and_end_program' 2025-07-17 21:39:26.073669162 Finished rear mkbackup in 1 seconds 2025-07-17 21:39:26.079900547 To remove the build area you may use (with caution): rm -Rf --one-file-system /var/tmp/rear.CM5M5KI3uIoB2V5 2025-07-17 21:39:26.082845343 End of program 'rear' reached 2025-07-17 21:39:26.085784583 Exit task '(( EXIT_FAIL_MESSAGE )) && echo 'rear mkbackup failed, check /var/log/rear/rear-rhel10.log for details' 1>&8' 2025-07-17 21:39:26.088607663 Exit task 'exec 8>&-' 2025-07-17 21:39:26.092359231 Exit task 'exec 7>&-' 2025-07-17 21:39:26.096495773 Exit task 'exec 6<&-' 2025-07-17 21:39:26.099342049 Exit task ''
Expected results
================================================
ReaR should abort execution immediately on syntax errors in local.conf to prevent unsafe or misconfigured backups.
Actual results
================================================
ReaR logs the syntax error but continues execution.