The view_exportimport command fails to authenticate when the password contains a special character and the password is passed along with the command

Article: 100046300
Last Published: 2019-09-19
Ratings: 0 0
Product(s): NetBackup & Alta Data Protection

Problem

Views that are created with a .csv or .tsv file can be imported into OpsCenter using either with Java View Builder application or via command line with the view_exportimport command. 

The location of the view_exportimport command:
  Windows:  <install_path>\OpsCenter\server\bin\view_exportimport.bat
  Linux:  /opt/SYMCOpsCenterServer/bin/view_exportimport.sh

When using the view_exportimport command the password and other parameters can be passed in the syntax instead of being interactively prompted for the needed parameters.  The switch for the password is:
--pass <password> 

The issue described in this article is specific to the use of the --pass switch. 
When using the view_exportimport command interactively this issue does not occur.

Error Message

The command line returns the following failure message:

Authentication Error: User could not be authenticated.
============================================================
Connected to the server: false
============================================================

Cause

If the password supplied contains a special character, the special character does not get escaped.

Solution

Put double quotes around the password and a ^ in front of the special character.
 

In the below examples the broker name is opscenter1, the port used is 1556, the user name is admin, the password for admin is P@ssw0rd, and the domain name is OpsCenterUsers

Example of incorrect syntax  (This will fail with the above message in the Error Message section):
D:\Program Files\Symantec\OpsCenter\server\bin\view_exportimport.bat -i -f "D:\Temp\test_view.csv" --type csv --broker opscenter1:1556:OPSCENTER_PBXSSLServiceID --usr admin --pass P@ssw0rd --domain OpsCenterUsers --domaintype vx


Example of correct password syntax that completes successfully:
D:\Program Files\Symantec\OpsCenter\server\bin\view_exportimport.bat -i -f "D:\Temp\test_view.csv" --type csv --broker opscenter1:1556:OPSCENTER_PBXSSLServiceID --usr admin --pass "P^@ssw0rd" --domain OpsCenterUsers --domaintype vx

 

References

Etrack : 3955764

Was this content helpful?