SystemLink TestMonitor Error: Password Authentication Failed

Updated Nov 4, 2024

Reported In

Software

  • SystemLink Test Module
  • SystemLink Server

Issue Details

  • The TesMonitor service always fails to start on my SystemLink Server. In the error logs, I see fatal error 28P01. How can I fix it?
  • On my SystemLink Server, the TestMonitor service errors with A connection to PostgreSQL was configured, but the service was unable to connect to the specified database.
  • In my SystemLink Skyline log, I see the below errors. What does this mean?

 

TestMonitor | ERROR - [Fatal] A connection to PostgreSQL was configured, but the service was unable to connect to the specified database. Error (Npgsql.PostgresException): 28P01: password authentication failed for user "nisystemlink"

TestMonitor | ERROR - TestMonitor.InvalidDatabaseConfiguration: Invalid database configuration. Please check TestMonitor.json in the Config directory.

 

TestMonitor error.PNG

Solution

This error occurs due to an invalid password in the PostgreSQLDatabase configuration file. It will be necessary to change the password configured for the PostgreSQLDatabase service.

To resolve this error, follow the steps below:

 

  1. Open the Windows Services application and stop the NI SystemLink Service Manager service.

 

Stop Service Manager.PNG

 

  1. In a text editor with administrator privileges, open C:\ProgramData\National Instruments\Skyline\PostgreSQLDatabase\pg_hba.conf (this is the default location).
  2. Scroll to the bottom of the file and find the section # IPv4 local connections:
  3. Add a # at the start of the line host    all             all             127.0.0.1/32            scram-sha-256

 

Commented out password requirement.PNG

 

  1. Above the commented line, add host    all             all             127.0.0.1/32            trust
    • This removes the need to provide a password to make a database connection.

 

new line trust.PNG

 

  1. Save and close the file.
  2. From the Start Menu, launch Command Prompt as an administrator.

 

Command Prompt admin.PNG

 

  1. Enter cd "C:\Program Files\National Instruments\Shared\Skyline\PostgreSQLDatabase\pgsql\bin" to navigate to folder containing the PostgreSQL binaries.

 

CD.PNG

 

  1. Type pg_ctl register -N postgres -D "C:\ProgramData\National Instruments\Skyline\PostgreSQLDatabase" and press Enter.

 

pgctl register.PNG

 

  1. Type net start postgres and press Enter to start the service.

 

start postgres.PNG

 

  1. Leaving Command Prompt open, open C:\ProgramData\National Instruments\Skyline\PostgreSQLDatabase\postgresql.conf in a text editor. 
  2. Scroll through the file to identity the line port = <port number>

 

port number file.PNG

 

  1. In Command Prompt, enter psql -h localhost -p <port> -U nisystemlink where <port> is the port number found in the postgresql.conf file.
    • This connects to the SystemLink Server's PostgreSQL database.

 

psql localhost.PNG

 

  1. Then enter ALTER USER nisystemlink with password '<password>'; where <password> is the new password to set.

 

new password.PNG

 

  1. Type quit to disconnect from the PostgreSQL database.

 

quit.PNG

 

  1. Enter net stop postgres to stop the service.

 

stop service'.PNG

 

  1. Type pg_ctl unregister -N postgres and then press Enter.

 

unregister.PNG

 

  1. Close Command Prompt.
  2. In a text editor with admin privileges, open C:\ProgramData\National Instruments\Skyline\PostgreSQLDatabase\pg_hba.conf
  3. Remove the changes made in steps 5 and 6. This includes:
    • Uncomment the line host    all             all             127.0.0.1/32            scram-sha-256
    • Delete the line host    all             all             127.0.0.1/32            trust

 

Changed pghba.PNG

 

  1. Save and close the file.
  2. In a text editor with admin privileges, open C:\ProgramData\National Instruments\Skyline\Config\PostgreSQLDatabase.json 
  3. Modify the Postgres.Password and Postgres.ConnectionString to include the new password configured in step 14. The format should resemble the following image.

 

new password JSON.PNG

 

  1. Save and close the file.
  2. Launch the NI SystemLink Server Configuration application.
  3. On the NI SystemLink Service Manager tab, click Restart to restart all services.

 

Restart all services.PNG

 

The TestMonitor service should now be fixed and running.