#515 Issue closed: 2014-12-11 12:04:50 ERROR: BUG BUG BUG! Function get_version could not detect parted version.

Labels: support / question

jeocampoar opened issue at 2014-12-11 18:21:

i have thi message on the console when i run rear backup Te OS id SUSE

SUSE LINUX Enterprise Server 9 (x86_64)
VERSION = 9
PATCHLEVEL = 4

=== Issue report ===
Please report this unexpected issue at: https://github.com/rear/rear/issues
Also include the relevant bits from /var/log/rear/rear-XXXXX.log

HINT: If you can reproduce the issue, try using the -d or -D option !
====================
2014-12-11 12:04:50 Running exit tasks.
2014-12-11 12:04:50 Finished in 1 seconds
2014-12-11 12:04:50 Removing build area /tmp/rear.BVjnTpLFAKE5167

jeocampoar commented at 2014-12-11 18:52:

lpbog19:~ # /usr/sbin/rear -vD mkbackup
/usr/sbin/rear: /usr/share/rear/lib/bootloader-functions.sh: line 121: conditional binary operator expected
/usr/sbin/rear: /usr/share/rear/lib/bootloader-functions.sh: line 121: syntax error near `=~'
/usr/sbin/rear: /usr/share/rear/lib/bootloader-functions.sh: line 121: `    if [[ "$USE_SERIAL_CONSOLE" =~ ^[yY1] ]]; then'
/usr/sbin/rear: /usr/share/rear/lib/layout-functions.sh: line 297: conditional binary operator expected
/usr/sbin/rear: /usr/share/rear/lib/layout-functions.sh: line 297: syntax error near `=~'
/usr/sbin/rear: /usr/share/rear/lib/layout-functions.sh: line 297: `    if [[ -n "$res" || "$AUTOEXCLUDE_MULTIPATH" =~ ^[yY1] ]]; then'
/usr/sbin/rear: /usr/share/rear/lib/udev-workflow.sh: line 53: conditional binary operator expected
/usr/sbin/rear: /usr/share/rear/lib/udev-workflow.sh: line 53: syntax error near `=~'
/usr/sbin/rear: /usr/share/rear/lib/udev-workflow.sh: line 53: `    if has_binary hpasmcli && [[ "$UDEV_UID_LED" =~ ^[yY1] ]]; then'
Relax-and-Recover 1.16.1-git201412101401 / 2014-12-10
Using log file: /var/log/rear/rear-lpbog19.log
Creating disk layout
ERROR: BUG BUG BUG!  Function get_version could not detect parted version.
=== Issue report ===
Please report this unexpected issue at: https://github.com/rear/rear/issues
Also include the relevant bits from /var/log/rear/rear-lpbog19.log

HINT: If you can reproduce the issue, try using the -d or -D option !
====================
Aborting due to an error, check /var/log/rear/rear-lpbog19.log for details
Terminated

logfile

++ ID_NEW=device not found in database
++ echo $'\377\377\377\377\377\377\377\377-\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377-generic' device not found in database
++ read ID
++ [[ -f /var/lib/rear/recovery/diskbyid_mappings ]]
++ Log 'Saved diskbyid_mappings'
++ test 1 -gt 0
+++ Stamp
+++ date '+%Y-%m-%d %H:%M:%S '
++ echo '2014-12-11 13:51:06 Saved diskbyid_mappings'
2014-12-11 13:51:06 Saved diskbyid_mappings
+ test 1
+ set +x
2014-12-11 13:51:06 Including layout/save/GNU/Linux/20_partition_layout.sh
+ . /usr/share/rear/layout/save/GNU/Linux/20_partition_layout.sh
++ FEATURE_PARTED_MACHINEREADABLE=
++ FEATURE_PARTED_OLDNAMING=
+++ get_version parted -v
/usr/sbin/rear: line 1: get_version: command not found
++ parted_version=
++ [[ -n '' ]]
++ BugIfError 'Function get_version could not detect parted version.'
++ ((  1 != 0  ))
++ BugError 'Function get_version could not detect parted version.'
++ '[' Function get_version could not detect parted version. -eq Function get_version could not detect parted version. ']'
++ EXIT_CODE=1
++ Error 'BUG BUG BUG! ' 'Function get_version could not detect parted version.' '
=== Issue report ===
Please report this unexpected issue at: https://github.com/rear/rear/issues
Also include the relevant bits from /var/log/rear/rear-lpbog19.log

HINT: If you can reproduce the issue, try using the -d or -D option !
===================='
++ '[' BUG BUG 'BUG!' -eq BUG BUG 'BUG!' ']'
++ EXIT_CODE=1
++ VERBOSE=1
++ LogPrint 'ERROR: BUG BUG BUG!  Function get_version could not detect parted version.
=== Issue report ===
Please report this unexpected issue at: https://github.com/rear/rear/issues
Also include the relevant bits from /var/log/rear/rear-lpbog19.log

HINT: If you can reproduce the issue, try using the -d or -D option !
===================='
++ Log 'ERROR: BUG BUG BUG!  Function get_version could not detect parted version.
=== Issue report ===
Please report this unexpected issue at: https://github.com/rear/rear/issues
Also include the relevant bits from /var/log/rear/rear-lpbog19.log

HINT: If you can reproduce the issue, try using the -d or -D option !
===================='
++ test 1 -gt 0
+++ Stamp
+++ date '+%Y-%m-%d %H:%M:%S '
++ echo '2014-12-11 13:51:06 ERROR: BUG BUG BUG!  Function get_version could not detect parted version.
=== Issue report ===
Please report this unexpected issue at: https://github.com/rear/rear/issues
Also include the relevant bits from /var/log/rear/rear-lpbog19.log

HINT: If you can reproduce the issue, try using the -d or -D option !
===================='
2014-12-11 13:51:06 ERROR: BUG BUG BUG!  Function get_version could not detect parted version.
=== Issue report ===
Please report this unexpected issue at: https://github.com/rear/rear/issues
Also include the relevant bits from /var/log/rear/rear-lpbog19.log

HINT: If you can reproduce the issue, try using the -d or -D option !
====================
++ Print 'ERROR: BUG BUG BUG!  Function get_version could not detect parted version.
=== Issue report ===
Please report this unexpected issue at: https://github.com/rear/rear/issues
Also include the relevant bits from /var/log/rear/rear-lpbog19.log

HINT: If you can reproduce the issue, try using the -d or -D option !
===================='
++ test 1
++ echo -e 'ERROR: BUG BUG BUG!  Function get_version could not detect parted version.
=== Issue report ===
Please report this unexpected issue at: https://github.com/rear/rear/issues
Also include the relevant bits from /var/log/rear/rear-lpbog19.log

HINT: If you can reproduce the issue, try using the -d or -D option !
===================='
++ has_binary caller
++ type caller
++ return 1
++ LogToSyslog 'ERROR: BUG BUG BUG!  Function get_version could not detect parted version.
=== Issue report ===
Please report this unexpected issue at: https://github.com/rear/rear/issues
Also include the relevant bits from /var/log/rear/rear-lpbog19.log

HINT: If you can reproduce the issue, try using the -d or -D option !
===================='
++ logger -t rear -i 'ERROR: BUG BUG BUG!  Function get_version could not detect parted version.
=== Issue report ===
Please report this unexpected issue at: https://github.com/rear/rear/issues
Also include the relevant bits from /var/log/rear/rear-lpbog19.log

HINT: If you can reproduce the issue, try using the -d or -D option !
===================='
++ kill -USR1 15642
+++ echo 'Aborting due to an error, check /var/log/rear/rear-lpbog19.log for details'
+++ kill 15642
++++ DoExitTasks
++++ Log 'Running exit tasks.'
++++ test 1 -gt 0
+++++ Stamp
+++++ date '+%Y-%m-%d %H:%M:%S '
++++ echo '2014-12-11 13:51:06 Running exit tasks.'
2014-12-11 13:51:06 Running exit tasks.
++++ JOBS=($(jobs -p))
+++++ jobs -p
++++ test ''
++++ Debug 'Exit task '\''cleanup_build_area_and_end_program'\'''
++++ test ''
++++ eval cleanup_build_area_and_end_program
+++++ cleanup_build_area_and_end_program
+++++ Log 'Finished in 0 seconds'
+++++ test 1 -gt 0
++++++ Stamp
++++++ date '+%Y-%m-%d %H:%M:%S '
+++++ echo '2014-12-11 13:51:06 Finished in 0 seconds'
2014-12-11 13:51:06 Finished in 0 seconds
+++++ test ''
+++++ Log 'Removing build area /tmp/rear.lGpVKNWlUE15689'
+++++ test 1 -gt 0
++++++ Stamp
++++++ date '+%Y-%m-%d %H:%M:%S '
+++++ echo '2014-12-11 13:51:06 Removing build area /tmp/rear.lGpVKNWlUE15689'
2014-12-11 13:51:06 Removing build area /tmp/rear.lGpVKNWlUE15689
+++++ rm -Rf /tmp/rear.lGpVKNWlUE15689/tmp
+++++ rm -Rf /tmp/rear.lGpVKNWlUE15689/rootfs
+++++ rmdir -v /tmp/rear.lGpVKNWlUE15689/outputfs
rmdir: removing directory, /tmp/rear.lGpVKNWlUE15689/outputfs
rmdir: `/tmp/rear.lGpVKNWlUE15689/outputfs': No such file or directory
+++++ mount
+++++ grep -q /tmp/rear.lGpVKNWlUE15689/outputfs
+++++ [[ 1 -eq 0 ]]
+++++ rmdir -v /tmp/rear.lGpVKNWlUE15689
rmdir: removing directory, /tmp/rear.lGpVKNWlUE15689
+++++ Log 'End of program reached'
+++++ test 1 -gt 0
++++++ Stamp
++++++ date '+%Y-%m-%d %H:%M:%S '
+++++ echo '2014-12-11 13:51:06 End of program reached'
2014-12-11 13:51:06 End of program reached
++++ Debug 'Exit task '\''exec 8>&-'\'''
++++ test ''
++++ eval 'exec 8>&-'
+++++ exec
++++ Debug 'Exit task '\''exec 7>&-'\'''
++++ test ''
++++ eval 'exec 7>&-'
+++++ exec

gdha commented at 2014-12-12 12:19:

Could you try bash -n /usr/share/rear/lib/bootloader-functions.sh and run bash --version. It could be that some code is not working with older bash versions?

jeocampoar commented at 2014-12-16 21:08:

I have this errors

bash -n /usr/share/rear/lib/bootloader-functions.sh
/usr/share/rear/lib/bootloader-functions.sh: line 121: conditional binary operator expected
/usr/share/rear/lib/bootloader-functions.sh: line 121: syntax error near =~' /usr/share/rear/lib/bootloader-functions.sh: line 121: if [[ "$USE_SERIAL_CONSOLE" =~ ^[yY1] ]]; then'
ibmadmjo@lpbog19:~> bash --version
GNU bash, version 2.05b.0(1)-release (x86_64-suse-linux)
Copyright (C) 2002 Free Software Foundation, Inc.

schlomo commented at 2014-12-16 21:12:

Is this a really old SUSE system? Please post the result of "lsb-release
-a" and "uname -a"

On 16 December 2014 at 22:08, jeocampoar notifications@github.com wrote:

I have this errors

bash -n /usr/share/rear/lib/bootloader-functions.sh
/usr/share/rear/lib/bootloader-functions.sh: line 121: conditional binary
operator expected
/usr/share/rear/lib/bootloader-functions.sh: line 121: syntax error near
='
/usr/share/rear/lib/bootloader-functions.sh: line 121: if [[
"$USE_SERIAL_CONSOLE" =
^[yY1] ]]; then'
ibmadmjo@lpbog19:~> bash --version
GNU bash, version 2.05b.0(1)-release (x86_64-suse-linux)
Copyright (C) 2002 Free Software Foundation, Inc.


Reply to this email directly or view it on GitHub
https://github.com/rear/rear/issues/515#issuecomment-67232184.

jeocampoar commented at 2014-12-16 21:15:

lpbog19:~ # lsb_release -a
LSB Version: 1.3
Distributor ID: SUSE LINUX
Description: SUSE LINUX Enterprise Server 9 (x86_64)
Release: 9
Codename: n/a
lpbog19:~ # uname -a
Linux lpbog19 2.6.5-7.308-smp #1 SMP Mon Dec 10 11:36:40 UTC 2007 x86_64 x86_64 x86_64 GNU/Linux
lpbog19:~ #

schlomo commented at 2014-12-16 21:37:

SLES9 is supposed to work, though it has been a couple of years since I met anybody still using it (and I am sure you have your good reasons for it).

I could imagine that Bash 2 does not know about =~ which is used in several places. To confirm you can try to run [[ foo =~ f ]] && echo yes

Do you need any of our new and fancy features? If not then I you could try downgrading ReaR to one of the 1.9 or 1.7 versions or even before (e.g. from http://sourceforge.net/projects/rear/files/rear/).

Another alternative is to replace all occurences of =~ in the code with something using expr, like

if [[ "$BACKUP_SELINUX_DISABLE" =~ ^[yY1] ]]; then

will be

if expr "$BACKUP_SELINUX_DISABLE" : ^[yY1] ; then

If that works and no other problems arise then I think that we should discuss if we want to keep supporting SLES9 in recent ReaR.

jeocampoar commented at 2014-12-18 19:04:

tnks, i install the version 1.9, only change the execute line:

/usr/sbin/rear -d mkbackup

and works

schlomo commented at 2014-12-18 21:37:

Nice. Be sure to also test the recovery :-)


[Export of Github issue for rear/rear.]