Problem
In NetBackup 8.2 adding a .sja package in nbrepo fails with Error: authorization failed.
A similar error message was seen in NetBackup 8.1.2 but that problem was resolved in version 8.2 (See article 100045650).
Error Message
# /usr/openv/netbackup/bin/admincmd/nbrepo -a vxupdate_nb_8.2_redhat_x64.sja
Adding package to the repository. This may take a few minutes...
Error: authorization failed.
The nbrepo logs show (found in /usr/openv/netbackup/logs/nbrepo):
09:14:49.323 [8683.1] <2> NBClientCURL::performCurlOperation: Fetched data = [xxxxx], httpcode = 401
09:14:49.324 [8683.1] <2> LoginWithCertManager::isRetryRequired: Webserver returned NB error code: 8000 do not retry.
09:14:49.324 [8683.1] <2> curlSendRequest: Http response body: {"errorCode":8000,"errorMessage":"The user does not have permission to perform the requested operation.","attributeErrors":{},"fileUploadErrors":[],"errorDetails":[]}
09:14:49.324 [8683.1] <2> curlSendRequest: Actual http response code: 401 , expected http response code: 201
09:14:49.324 [8683.1] <16> parseJSONErrorResponse: Error code returned by server is : 8000.
09:14:49.324 [8683.1] <16> parseJSONErrorResponse: Error message returned by server: The user does not have permission to perform the requested operation..
09:14:49.324 [8683.1] <16> addPackagesCmd: Failed to add deployment package metadata. Error code returned from curlSendRequest: 8000.
09:14:49.324 [8683.1] <2> NBClientCURL:~NBClientCURL: Performing curl_easy_cleanup()
09:14:49.325 [8683.1] <2> nbclnt_curl_prefnet::reset: Returning VN_STATUS_SUCCESS 09:14:49.325 [8683.1] <16> main: authorization failed.
09:14:49.325 [8683.1] <4> main: nbrepo exit status: [8000]
Cause
Hostname and/or aliases need to be registered correctly to allow webservices to work. In this case the issue was due to a host mapping issue. To check run:
# /usr/openv/netbackup/bin/admincmd/nbhostmgmt -list
Host ID : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Host : MasterB
Master Server : MasterA
OS Type : UNIX
Version : NetBackup_8.2
Secure : Yes
Mapped Host Name Approved Conflict Auto-discovered
MasterB Yes No Yes
This shows that the Host's name is different than the Master server client_name.
Solution
Ensure you are logged in as root before running nbrepo.
To check the host mapping you will need to log into the web service first.
1: # /usr/openv/netbackup/bin/bpnbat -login -logintype WEB
2: # /usr/openv/netbackup/bin/admincmd/nbhostmgmt -list
Check the master servers host name compared to that the Master servers knows itself by in bp.conf.
# /usr/openv/netbackup/bin/admincmd/nbhostmgmt -list
Host ID : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Host : MasterB
Master Server : MasterA
Mapped Host Name Approved Conflict Auto-discovered
MasterB Yes No Yes
3: Add host mapping.
nbhostmgmt -add -hostid xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -mappingname MasterA
4: After adding the mapping, you will need to remove the file webtoken.dat found at the following location:
/usr/openv/tmp/<masterserver>.1.webtoken.dat
Removing the webtoken.dat file will force a certificate reauthentication and this token will then auto regenerate.
Try adding the .sja package again with nbrepo command. It should now be successful.