Error: Unable to Connect to Database. Unhandled Classified Exception
Issue
Connector tests fail. The following errors appear:
Unable to connect to database.
Unknown failure.
Unhandled classified exception.
Environment
- PostgreSQL connectors using the
pgoutput
plugin - Update Method: Logical Replication
Resolution
To resolve this issue, check whether the replication slot you provided us with in the connector setup form can be found. You can use the following query in your database:
select * from pg_replication_slots where slot_name='replication_slot_name'
Alternatively, you can get a list of all logical replication slots in your database by running the following query:
select slot_name from pg_replication_slots where WHERE slot_type='logical'
If neither of the above queries return the applicable replication slot, you can create it using the following query:
select pg_create_logical_replication_slot('replication_slot_name', 'pgoutput')
Cause
When you select the Logical Replication update method while setting up your connector, you must provide the name of your database's replication slot. For more information, see your PostgreSQL connector's setup guide.
This issue occurs when the replication slot you provide us with doesn't exist or we're unable to find it in your database.