#2706 Issue closed: Integration Rear with Bareos

Labels: support / question, fixed / solved / done, external tool

wkuchta opened issue at 2021-11-05 07:09:

  • ReaR version ("/usr/sbin/rear -V"):
    Relax-and-Recover 2.6 / 2020-06-17

  • OS version ("cat /etc/os-release" or "lsb_release -a" or "cat /etc/rear/os.conf"):
    OS_VENDOR=RedHatEnterpriseServer
    OS_VERSION=8

  • ReaR configuration files ("cat /etc/rear/site.conf" and/or "cat /etc/rear/local.conf"):
    BACKUP=BAREOS
    BAREOS_CLIENT=agraph.xxx-fd

  • Description of the issue (ideally so that others can reproduce it):

Hi, so when I try to make ReaR ISO a have this error:

Relax-and-Recover 2.6 / 2020-06-17
Running rear mkrescue (PID 148666)
Using log file: /var/log/rear/rear-localhost.log
Running workflow mkrescue on the normal/original system
Using autodetected kernel '/boot/vmlinuz-4.18.0-305.12.1.el8_4.x86_64' as kernel in the recovery system
ERROR: Bareos client status unknown on director.
Some latest log messages since the last called script 500_check_BAREOS_bconsole_results.sh:
  2021-11-05 07:58:01.949431092 Including prep/BAREOS/default/500_check_BAREOS_bconsole_results.sh
  2021-11-05 07:58:01.957524046 Skipping ping test
Aborting due to an error, check /var/log/rear/rear-localhost.log for details
Exiting rear mkrescue (PID 148666) and its descendant processes ...
Running exit tasks
Terminated

From bereos i have information that backup works fine.

jsmeix commented at 2021-11-09 15:37:

The ERROR: Bareos client status unknown on director comes from
usr/share/rear/prep/BAREOS/default/500_check_BAREOS_bconsole_results.sh
https://github.com/rear/rear/blob/master/usr/share/rear/prep/BAREOS/default/500_check_BAREOS_bconsole_results.sh
but I cannot tell what went wrong why that error happens
because I do not use Bareos.

In general regarding issues with third-party backup tools:
Usually we at ReaR upstream do not use third-party backup tools
so usually we cannot reproduce issues with third-party backup tools.
Nevertheless we try to help - provided we get sufficient information
so that we have a chance to provide some useful help, cf.
"Debugging issues with Relax-and-Recover" in
https://en.opensuse.org/SDB:Disaster_Recovery

In particular regarding Bareos you may also contact the Bareos team via
https://github.com/bareos

gdha commented at 2021-11-09 16:22:

@wkuchta what version of bareos are you using? I usually have in my test setup the following defined:

BACKUP=BAREOS
BAREOS_RESTORE_JOB=client-restore
BAREOS_FILESET=client-fileset
BAREOS_RECOVERY_MODE="automatic"

PROGS+=( showmount mount.nfs umount.nfs )
MODULES+=( nfs )
PRE_RECOVERY_SCRIPT="systemctl start rpcbind.target || rpcbind &"

The NFS part is probably not required for your case as I do mount a NFS mount point...

wkuchta commented at 2021-11-17 07:52:

Thanks for the answers.
It seems ReaR needs a bconsole.conf file configured to connect to the Bereos server.
I couldn't find it.
I am still thinking about security, because then it gives the client access to the Bareosa console. But that's probably a question for Bareos.
Regards.

gdha commented at 2021-11-17 10:35:

@wkuchta May I suggest before asking BAreos support to run rear -vdD mkrescue once more and look in the rear log file for the output of the script 500_check_BAREOS_bconsole_results.sh - you may paste the output in this issue.

wkuchta commented at 2021-11-17 13:55:

Relax-and-Recover 2.6 / 2020-06-17
Running rear mkrescue (PID 286934)
Using log file: /var/log/rear/rear-localhost.log
Running workflow mkrescue on the normal/original system
Using autodetected kernel '/boot/vmlinuz-4.18.0-305.12.1.el8_4.x86_64' as kernel in the recovery system
ERROR: Bareos client status unknown on director.
Some latest log messages since the last called script 500_check_BAREOS_bconsole_results.sh:
2021-11-17 11:37:07.792065767 Including prep/BAREOS/default/500_check_BAREOS_bconsole_results.sh
2021-11-17 11:37:07.793783887 Entering debugscript mode via 'set -x'.
2021-11-17 11:37:07.807454081 Skipping ping test
Aborting due to an error, check /var/log/rear/rear-localhost.log for details
Exiting rear mkrescue (PID 286934) and its descendant processes ...
Running exit tasks
You should also rm -Rf /tmp/rear.VlfYePH7I3RT6WU
Terminated

gdha commented at 2021-11-17 14:46:

@wkuchta the /var/log/rear/rear-localhost.log contains more in-depth information I would like to see.

wkuchta commented at 2021-11-18 06:48:

rear-localhost.log

gdha commented at 2021-11-18 07:14:

Here it goes wrong:

2021-11-17 11:37:07.792065767 Including prep/BAREOS/default/500_check_BAREOS_bconsole_results.sh
2021-11-17 11:37:07.793783887 Entering debugscript mode via 'set -x'.
+ source /usr/share/rear/prep/BAREOS/default/500_check_BAREOS_bconsole_results.sh
++ '[' '' -o '' ']'
+++ bconsole -xc
+++ grep -i address
+++ awk '{ print $3 }'
++ BAREOS_DIRECTOR='"localhost"'
++ '[' '"localhost"' ']'
++ StopIfError 'Director not configured in bconsole'
++ ((  0 != 0  ))
++ test ''
++ Log 'Skipping ping test'
++ echo '2021-11-17 11:37:07.807454081 Skipping ping test'
2021-11-17 11:37:07.807454081 Skipping ping test
++ '[' -z localhost.localdomain-fd ']'
++ BAREOS_RESULT=(`echo -e " status client=${BAREOS_CLIENT}" | bconsole |grep Connect `)
+++ echo -e ' status client=localhost.localdomain-fd'
+++ bconsole
+++ grep Connect
++ director=localhost:9101
++ client=
++ '[' localhost:9101 ']'
++ StopIfError 'Bareos director not reachable.'
++ ((  0 != 0  ))
++ '[' '' ']'
++ StopIfError 'Bareos client status unknown on director.'
++ ((  1 != 0  ))
++ Error 'Bareos client status unknown on director.'
++ PrintError 'ERROR: Bareos client status unknown on director.'
++ PrintError 'Some latest log messages since the last called script 500_check_BAREOS_bconsole_results.sh:'
++ PrintError '  2021-11-17 11:37:07.792065767 Including prep/BAREOS/default/500_check_BAREOS_bconsole_results.sh
  2021-11-17 11:37:07.793783887 Entering debugscript mode via '\''set -x'\''.
  2021-11-17 11:37:07.807454081 Skipping ping test'
++ Log 'ERROR: Bareos client status unknown on director.'
++ echo '2021-11-17 11:37:22.834857298 ERROR: Bareos client status unknown on director.'
2021-11-17 11:37:22.834857298 ERROR: Bareos client status unknown on director.

Perhaps, could you do the following test manually:
echo -e ' status client=localhost.localdomain-fd' | bconsole | grep Connect
I guess the client hostname is not the same somehow?

wkuchta commented at 2021-11-18 09:39:

Okay, my mistake, I changed my name to the client to localhost.localdomain-fd somewhere in various attempts. Already restored correct, but the error is the same.
The client hostname in /etc/rear/local.conf and on the Bareos server are the same.
However, the Director is wrong. There is localhost: 9101 and should be the Bareos server address.
This can be changed by editing the /etc/bareos/bconsole.conf file, but then we get the client access to the Bareos server console which creates security problems.
At least I think so.

gdha commented at 2021-11-18 15:59:

Now I am confused, so you are telling me in local.conf you still have:
BAREOS_CLIENT=agraph.xxx-fd
But when running we see: BAREOS_DIRECTOR="localhost" and by running script 500_check_BAREOS_bconsole_results.sh
will result in:
director=localhost:9101
client=

Please run echo -e ' status client=<client-name-you-have> | bconsole | grep Connect

wkuchta commented at 2021-11-19 07:58:

Ok, so:
in /etc/rear/local.conf:
BAREOS_CLIENT = agraph.xxx-fd
Result echo -e 'status client = agraph.xxx-fd' | bconsole | grep Connect:
Connecting to Director localhost:9101
And I attach the file /var/log/rear/rear-localhost.log again
rear-localhost.log

++ '[' -z agraph.xxx-fd ']'
++ BAREOS_RESULT=(`echo -e " status client=${BAREOS_CLIENT}" | bconsole |grep Connect `)
+++ echo -e ' status client=agraph.xxx-fd'
+++ bconsole
+++ grep Connect
++ director=localhost:9101
++ client=

gdha commented at 2021-11-19 09:04:

@wkuchta what is the result of rpm -qa | grep bareos? If time permits I will check it why the above output did not revealed the client's name.

wkuchta commented at 2021-11-19 13:34:

rpm -qa | grep bareos:
bareos-client-19.2.7-2.el8.x86_64
bareos-common-19.2.7-2.el8.x86_64
bareos-bconsole-19.2.7-2.el8.x86_64
bareos-filedaemon-19.2.7-2.el8.x86_64

gdha commented at 2021-12-13 11:14:

I executed a test with rear-automated-testing with BAREOS 19.2.7 and I had no issues - see gist output

jsmeix commented at 2022-01-31 10:56:

I assume this issue was sufficiently solved.


[Export of Github issue for rear/rear.]