#2162 Issue closed: NSRSERVER is missing

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

viper1986 opened issue at 2019-06-26 12:44:

Relax-and-Recover (ReaR) Issue Template

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.4 / 2018-06-21

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

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

BACKUP=NSR
OUTPUT=ISO
OUTPUT_URL=nfs://169.254.251.200/rear
NSRSERVER=c301bcksrv1.bck.service.itdn.org
OUTPUT_OPTIONS="nfsvers=3,nolock"
KEEP_OLD_OUTPUT_COPY=y
POOLNAME=dd_os_all
NSR_RETENTION_TIME=Month
USE_CFG2HTML=y
AUTOEXCLUDE_MULTIPATH=n
BOOT_OVER_SAN=y
  • Hardware (PC or PowerNV BareMetal or ARM) or virtual machine (KVM guest or PoverVM LPAR):
    PoverVM LPAR

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

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

  • Description of the issue (ideally so that others can reproduce it):
    I use BACKUP=NSR and setup NSRSERVER in site.conf file.
    This is first backup and the /nsr/res/nsrladb is not exist, also I don't use servers file.

When I run rear mkbackup variable NSRSERVER is set to none by script 650_check_iso_recoverable.sh:

2019-06-26 13:57:32.916617483 Including layout/save/default/450_check_network_files.sh
2019-06-26 13:57:32.920296595 Including layout/save/GNU/Linux/500_extract_vgcfg.sh
2019-06-26 13:57:33.134367561 Including layout/save/GNU/Linux/510_current_disk_usage.sh
2019-06-26 13:57:33.142667368 Including layout/save/default/600_snapshot_files.sh
2019-06-26 13:57:33.149829316 Including layout/save/NSR/default/650_check_iso_recoverable.sh
cat: /var/lib/rear/recovery/nsr_server: No such file or directory
2019-06-26 13:57:33.156270045 No Networker ISO Backups found.
2019-06-26 13:57:33.157700480 Finished running 'layout/save' stage in 8 seconds
2019-06-26 13:57:33.158781120 ======================
2019-06-26 13:57:33.159677787 Running 'rescue' stage
2019-06-26 13:57:33.160673863 ======================
...
2019-06-26 13:57:37.030321758 Created the EMC NetWorker nsrexecd start-up script (90-networker.sh) for ReaR
2019-06-26 13:57:37.034303022 Including rescue/NSR/default/460_save_nsr_server_name.sh
2019-06-26 13:57:37.038205971 The EMC NetWorker server name could not be found automatically.
2019-06-26 13:57:37.039712655 ERROR: Please define manually the EMC NetWorker server name under /nsr/res/servers
==== Stack trace ====
Trace 0: /usr/sbin/nsr_rear:543 main
Trace 1: /usr/share/rear/lib/mkbackup-workflow.sh:13 WORKFLOW_mkbackup
Trace 2: /usr/share/rear/lib/framework-functions.sh:101 SourceStage
Trace 3: /usr/share/rear/lib/framework-functions.sh:49 Source
Trace 4: /usr/share/rear/rescue/NSR/default/460_save_nsr_server_name.sh:14 source
Message: Please define manually the EMC NetWorker server name under /nsr/res/servers

I add echo "$NSRSERVER" in front of NSRSERVER=$(cat $VAR_DIR/recovery/nsr_server ) in file 650_check_iso_recoverable.sh :

2019-06-26 14:27:23.199212379 Including layout/save/NSR/default/650_check_iso_recoverable.sh
c301bcksrv1.bck.service.itdn.org
cat: /var/lib/rear/recovery/nsr_server: No such file or directory
2019-06-26 14:27:23.205755228 No Networker ISO Backups found.
2019-06-26 14:27:23.207091227 Finished running 'layout/save' stage in 8 seconds
...
2019-06-26 14:27:27.164521295 Created the EMC NetWorker nsrexecd start-up script (90-networker.sh) for ReaR
2019-06-26 14:27:27.168189601 Including rescue/NSR/default/460_save_nsr_server_name.sh
2019-06-26 14:27:27.171916754 The EMC NetWorker server name could not be found automatically.
2019-06-26 14:27:27.173309183 ERROR: Please define manually the EMC NetWorker server name under /nsr/res/servers
==== Stack trace ====
Trace 0: /usr/sbin/nsr_rear:543 main
Trace 1: /usr/share/rear/lib/mkbackup-workflow.sh:13 WORKFLOW_mkbackup
Trace 2: /usr/share/rear/lib/framework-functions.sh:101 SourceStage
Trace 3: /usr/share/rear/lib/framework-functions.sh:49 Source
Trace 4: /usr/share/rear/rescue/NSR/default/460_save_nsr_server_name.sh:14 source
Message: Please define manually the EMC NetWorker server name under /nsr/res/servers

I'm not sure that this should work in that way. There should be some if statement to detect if NSRSERVER is set or not.

jsmeix commented at 2019-06-27 08:55:

@viper1986
regarding BACKUP=NSR:
In general there is nothing at all what I could do in case of issues
with third-party backup tools or any other third-party software
because I do not have such software on my test systems
so that I can neither test nor reproduce anything.

The last two adaptions and enhancements
for BACKUP=NSR were done by
@hpannenb via
https://github.com/rear/rear/pull/2058
and
https://github.com/rear/rear/pull/1584

@hpannenb
could you have a look here?

gdha commented at 2019-09-11 12:11:

@viper1986 Please check the script /usr/share/rear/rescue/NSR/default/460_save_nsr_server_name.sh which should have safed the NSRSERVER content to the file $VAR_DIR/recovery/nsr_server
Please run rear vD mkrescue for debugging output. It will allow you to see what really happens in the above mentioned script.

hpannenb commented at 2019-09-13 05:43:

@viper1986 and @gdha: Sorry for answering so late. As far as I can see the code changes I made do not affect the NSRSERVER variable. In my environment the NSRSERVER will be automatically detected with means of the code of 460_save_nsr_server_name.sh.

gdha commented at 2019-10-05 10:01:

@hpannenb Code changes you made? Sorry, are you referring to an older PR? (And now I'm so late with my answer)

viper1986 commented at 2019-10-07 11:05:

Hello all,
@hpannenb in 460_save_nsr_server_name.sh there is a if:

if [[ ! -z "$NSRSERVER" ]]; then
    : # do nothing
elif [[ -f $NSR_ROOT_DIR/res/servers ]]; then
    NSRSERVER=$( cat $NSR_ROOT_DIR/res/servers | head -1 )
elif [[ -d $NSR_ROOT_DIR/res/nsrladb/03 ]]; then
    NSRSERVER=$(grep servers $NSR_ROOT_DIR/res/nsrladb/*/* | tail -1 | awk '{print $2}' | sed -e 's/[;,]//' )
fi
  • $NSR_ROOT_DIR/res/servers - I do not use this file
  • $NSR_ROOT_DIR/res/nsrladb/03 - is not exist when there is no backup performed before
  • $NSRSERVER - is set to null by script 650_check_iso_recoverable.sh which is running before 460_save_nsr_server_name.sh

Script 650_check_iso_recoverable.sh contains line:

NSRSERVER=$(cat $VAR_DIR/recovery/nsr_server )
  • file $VAR_DIR/recovery/nsr_server is not exist in my case because this is first backup of this server.

I think that script 650_check_iso_recoverable.sh contains should looks a little bit different for example
if file $VAR_DIR/recovery/nsr_server is not exist, use variable from file site.conf or os.conf ... or something like that.

hpannenb commented at 2019-10-12 17:05:

@gdha and @viper1986: What I mean is I did not write the main code for the Legato Networker and just added few snippets (the NSR_CLIENT_MODE) to the existing NSR workflow.

@viper1986:
Proposed workaround(s):
In 650_check_iso_recoverable.sh comment in the line as follows
#NSRSERVER=$(cat $VAR_DIR/recovery/nsr_server )
or
use the more sofisticated code snippet taken from 400_verify_nsr.sh instead:
[...]

if [[ ! -z "$NSRSERVER" ]]; then
    Log "NSRSERVER ($NSRSERVER) was defined in $CONFIG_DIR/local.conf"
elif [[ -f $VAR_DIR/recovery/nsr_server ]]; then
    NSRSERVER=$( cat $VAR_DIR/recovery/nsr_server )
else
    Error "Could not retrieve the EMC NetWorker Server name. Define NSRSERVER in $CONFIG_DIR/local.conf file"
fi

[...]

Please let us know if this working for You. I think a final code change will be required in the script otherwise Your NSR approach will not work for anyone.

P.S.:
I checked the 1st workaround in my company's environment and it is working as supposed:

  1. Set the NSRSERVER=testing inlocal.conf: In script 650_check_iso_recoverable.sh the nsrinfo -s testing -N ... fails. => "testing" server does not exist: OK.
  2. Set NSRSERVER to the correct name in local.conf: Networker backup of ISO works as supposed to. => OK.
  3. Remove NSRSERVER in local.conf: NSRSERVER is gathered from /nsr/resr/nsrladb/...and Networker backup of ISO works as supposed to. => OK.
  4. Remove NSRSERVER in local.conf and re-create /nsr/res/servers (default in my company: Networker backup of ISO works as supposed to. => OK.

So IMHO removing the line NSRSERVER=$(cat $VAR_DIR/recovery/nsr_server ) from the script 650_check_iso_recoverable.sh in the existing code will not harm the execution of the NSR workflow.

jsmeix commented at 2019-11-05 13:34:

I do not use NSR but I hope
with https://github.com/rear/rear/pull/2271 merged
this issue is fixed.

@hpannenb
thank you for your fix!


[Export of Github issue for rear/rear.]