Error While Using SSH Tunnel: The Connection Attempt Failed
Issue
While connecting a database connector using an SSH tunnel, the following error appears:
The connection attempt failed
Environment
Database connectors using the SSH tunnel connection method
Cause
The connector is unable to connect to the source database. The connection attempt may have failed for one of the following reasons:
- The remote host is terminating the connection.
- The remote host is blocking Fivetran through a firewall.
- The remote host is timing out the connection.
Resolution
- Make sure all credentials are correct.
- Verify that IPs are allowed from the public Internet to the SSH server bi-directionally on port
22
. - Tail the SSH logs to check for errors between the SSH server and the source database:
- Run either the
sudo tail -f /var/log/auth.log
orsudo tail -f /var/log/secure
command. - Run the setup tests.
- Check the tail for errors.
- Run either the
- If there's an error in connecting to the source database, show that error output to your network admin.
- Attempt connecting to the database from the SSH server.
- Use a machine separated by the Internet and connect to the source database through the SSH server. 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.