PostgreSQL authentication failure during Applications Manager startup

PostgreSQL authentication failure during Applications Manager startup

Problem:
Applications Manager fails to start due to PostgreSQL authentication failure and shows the following error:

The following errors are observed in the startup log (StartUpLogs_err.log) file, located under <Applications Manager Home>\logs\ directory:
Quote
FATAL: password authentication failed for user "postgres"
FATAL: password authentication failed for user "dbuser"

Reason:

This issue usually occurs due to one of the following reasons:

  1. PostgreSQL is upgraded from a lower version to a higher version.
  2. Database credentials or encryption mismatch.
  3. Incorrect database connection settings.

Solution: 
Follow the steps below based on your PostgreSQL configuration type: 

Scenario 1: Remote PostgreSQL configuration

If Applications Manager is configured to use Remote PostgreSQL and authentication fails, ensure the following settings are correct:

Step 1 – Update AMServer.properties file
1. Stop Applications Manager.
2. Open the following file:<Applications Manager Home>\conf\AMServer.properties
3. Modify the following property:  
QuoteFrom: 
am.dbport.check=true 

To: 
am.dbport.check=false
4. Specify the correct database port value: 
QuoteFrom: 
am.db.port=15432 

To: 
am.db.port=<PostgreSQL_Port> 

Example:

am.db.port=5432
5. Save the file.

Step 2 – Update database_params.conf file
Open the file: <Applications Manager Home>\working\conf\database_params.conf . Then check and update the following entries:

1. JDBC URL: 
Quote
From: 
url jdbc:postgresql://localhost:15432/amdb?ApplicationName=ApplicationsManager&dontTrackOpenResources=true&useUnicode=true&characterEncoding=UTF-8 AppModules TopoDB-MapDB-EventDB-AlertDB-PollDB-PolicyDB-USERSTORAGEDB-ApplnDB

To:
url jdbc:postgresql://<PostgreSQL_Host>:<PostgreSQL_Port>/amdb?ApplicationName=ApplicationsManager&dontTrackOpenResources=true&useUnicode=true&characterEncoding=UTF-8 AppModules TopoDB-MapDB-EventDB-AlertDB-PollDB-PolicyDB-USERSTORAGEDB-ApplnDB

Example:
url jdbc:postgresql://123.456.789.000:5432/amdb?ApplicationName=ApplicationsManager&dontTrackOpenResources=true&useUnicode=true&characterEncoding=UTF-8 AppModules TopoDB-MapDB-EventDB-AlertDB-PollDB-PolicyDB-USERSTORAGEDB-ApplnDB

2. Database username:
QuoteFrom:
username dbuser AppModules TopoDB-MapDB-EventDB-AlertDB-PollDB-PolicyDB-USERSTORAGEDB-ApplnDB

To:
username <PostgreSQL Username> AppModules TopoDB-MapDB-EventDB-AlertDB-PollDB-PolicyDB-USERSTORAGEDB-ApplnDB

Example:
username apm AppModules TopoDB-MapDB-EventDB-AlertDB-PollDB-PolicyDB-USERSTORAGEDB-ApplnDB

3. Database password:
Quote
From:
encryptedpassword <value> AppModules TopoDB-MapDB-EventDB-AlertDB-PollDB-PolicyDB-USERSTORAGEDB-ApplnDB

To:
password <PostgreSQL Password> AppModules TopoDB-MapDB-EventDB-AlertDB-PollDB-PolicyDB-USERSTORAGEDB-ApplnDB

Example:
password appmanager AppModules TopoDB-MapDB-EventDB-AlertDB-PollDB-PolicyDB-USERSTORAGEDB-ApplnDB

Step 3 – Additional database configurations
  1. Take backup of startPGSQL.bat/.sh and stopPGSQL.bat/.sh files located under <Applications Manager Home>/working/bin/ directory.
  2. Delete all the files under <Applications Manager Home>/logs/ directory.
  3. Ensure whether <Applications Manager Home>/working/pgsql/data/<DB_NAME>/pg_hba.conf file allows the Applications Manager server IP.
  4. Verify whether listen_addresses in <Applications Manager Home>/working/pgsql/data/<DB_NAME>/postgresql.conf file includes the Applications Manager server IP.
  5. Start Applications Manager.

Scenario 2: Bundled PostgreSQL configuration

If Applications Manager uses the bundled PostgreSQL and authentication fails, follow the steps given below based on the type of database user:


Case 1 – postgres user authentication failure
Open the file: <Applications Manager Home>\working\conf\database_params.conf . Locate the database credentials and update the following entries:
Quote
From:
# Super-user username and Super-user password for the database
su_username=postgres
su_encryptedpassword=5ed2f7ae106bd7e64f69d3be3d86867df52f9c10607c52f19e18a0fda6e125e17fad42c3229bdff0281e7c9b90b6ca38506cbdf310c7420c3eda2af856c3fa6d

# To update credentials of login user (dbuser) and read-only user (rouser) if any
updatedbuser=false
updaterouser=false
updatesuuser=false


To:
# Super-user username and Super-user password for the database
su_username=postgres
su_password=appmanager

# To update credentials of login user(dbuser) and read-only user(rouser) if any
updatedbuser=true
updaterouser=true
updatesuuser=true

Case 2 – dbuser authentication failure
Open the file: <Applications Manager Home>\working\conf\database_params.conf . Locate the database credentials and update the following entries:
Quote
From:
# To update credentials of login user(dbuser) and read-only user(rouser) if any
updatedbuser=false
updaterouser=false

# login password for the database if any
encryptedpassword <hash> AppModules TopoDB-MapDB-EventDB-AlertDB-PollDB-PolicyDB-USERSTORAGEDB-ApplnDB


To:
# To update credentials of login user(dbuser) and read-only user(rouser) if any
updatedbuser=true
updaterouser=true

# login password for the database if any
password <hash> AppModules TopoDB-MapDB-EventDB-AlertDB-PollDB-PolicyDB-USERSTORAGEDB-ApplnDB

where, <hash> represents the password of the PostgreSQL database.

Once all the above steps are implemented, start Applications Manager.

                  New to ADSelfService Plus?