Error: The Connection Attempt Failed (Direct Connection Method)
Issue
The following error appears:
PSQLException: The connection attempt failed.
Environment
- Connector: PostgreSQL
- Connection method: SSH tunnel
Cause
The connector is unable to connect to the source database. The connection attempt may have failed for one of the following reasons:
- The source is terminating the connection.
- The source is blocking Fivetran through a firewall.
- The source is timing out the connection.
Resolution
- Make sure all credentials are correct.
- Verify the source database has a public-facing IP address.
- Verify that IPs are allowed from the public Internet to the source database bi-directionally on the database port.
TIP:
5432
is the default port, but check with your administrator to be sure. - Use the public IP instead of the hostname.
- Attempt to connect to the source database from a machine separated by the Internet. This method mimics how Fivetran connects to your database and can recreate the error conditions you see in the Fivetran dashboard.
TIP: Dbeaver is a free database connection UI that you may want to use. You can find instructions for installing PSQL with
brew
on the PostgreSQL Wiki's Homebrew page.