Troubleshooting "Failed to Connect to Datasource" Error in BDRSuite or BDRSuite Offsite DR Console

Troubleshooting "Failed to Connect to Datasource" Error in BDRSuite or BDRSuite Offsite DR Console"

KB ID: 117022
Issue:
Users encounter the "Failed to Connect to Datasource" alert when attempting to log in through the console of BDRSuite or BDRSuite Offsite DR. This alert arises from a problem with PostgreSQL connectivity and is observed in the following scenarios:
1. Initial login after fresh installation.
2. Logging into an existing server.
3. Initial login after upgrading from an older version to a new version.
4. Exceeding the client connection limit, leading to the exit of VembuPostgreSQL and login failure.
Solution:
For Fresh Installations and Upgrades:
In this case, improper installation of the ODBC driver during PostgreSQL installation could be the cause. To address this:
1. Navigate to the Start menu and search for 'ODBC Data Sources' [64 bit] open it.
2. Select the 'SystemDSN' tab and click on 'PostGreDBConnection'.
3. Click 'Configure' and verify the following parameters:
  1. DataSource: PostGreDBConnection
  2. Database: SGDatabase
  3. Server: localhost
  4. Username: postgres
  5. Port: 32010 (or the installation-specified port)
  6. Password: admin (type 'admin' in the designated field)
4. After verifying these parameters, click 'Test'. If the test is successful, the issue is resolved.
5. If the test fails, navigate to "C:/Program Files/Vembu/VembuBDR/conf" and open SGConfiguration.conf in a text editor. Look for 'ODBC' and cross-reference the Database name, username, and password with those in the ODBC Datasource connection.
6. After editing and saving SGConfiguration.conf, restart the BDRSuite service from services.msc.
7. If the datasource name is not listed, consider reinstalling the server (This step is only for Fresh installations and not for upgrades. It is necessary in cases of rare intermediate PostgreSQL installation failures).
For Existing Servers:
In this scenario, the issue could arise if PostgreSQL services are stopped or if the maximum number of sockets has been reached. To resolve this:
1. Restart PostgreSQL services (BDRSuite_PostgreSQL_DB) from services.msc.
Following these steps should help address the "Failed to Connect to Datasource" error and restore proper connectivity in the BDRSuite or BDRSuite Offsite DR console.