Error connecting to a Postgres database from a PAM process
search cancel

Error connecting to a Postgres database from a PAM process

book

Article ID: 271010

calendar_today

Updated On:

Products

CA Process Automation Base

Issue/Introduction

After implementing this KB article to connect to a Postgres database, the following error appears:

Could not connect to the database;  - url=jdbc:postgres://<hostname>:<post>//<dbname> - No suitable driver found for jdbc:postgres://<hostname>:<post>//<dbname>

c2o.log in INFO and DEBUG levels show:

ERROR [com.optinuity.c2o.service.serviceoperation.jdbcserviceoperation.RunnerJDBCGenericSQLServiceOperation] [9e-42125532a394] null failed to execute:
com.optinuity.c2o.util.C2OException: Could not connect to the database;  - jdbc:postgres://<hostname>:<post>//<dbname> - No suitable driver found for jdbc:postgres://<hostname>:<post>//<dbname>
at com.optinuity.c2o.service.serviceoperation.jdbcserviceoperation.RunnerJDBCGenericSQLServiceOperation.processRequestedOperation(RunnerJDBCGenericSQLServiceOperation.java:238)
at com.optinuity.c2o.service.serviceoperation.jdbcserviceoperation.RunnerJDBCGenericSQLServiceOperation.run(RunnerJDBCGenericSQLServiceOperation.java:80)
at java.lang.Thread.run(Thread.java:750)

Environment

Release : 4.3 / 4.4

Resolution

1. Set the "Connection URL" format to something similar to:

"jdbc:postgresql://<hostname>:<port>/<database name>?user=<username>&password=<password>"

or without username/password

ie: "jdbc:postgresql://<hostname>:<port>/<database name>"

2. If the issue remains, ensure that Postgres is allowing remote connections. 

OOTB Postgres does not allow external connections. You can confirm this by running the following from the PAM server, open powershell and run:

Test-NetConnection -ComputerName <postgres servername> -Port <port>

If the connection fails, ensure the firewall allows the connection and implement the following to allow external connections to Postgres database:

https://www.netiq.com/documentation/identity-manager-47/setup_windows/data/connecting-to-a-remote-postgresql-database.html