Summary/Reported Issue
Unable to connect to a PostgreSQL database via Dremio, while connections via pgAdmin from a local environment are successful.
Troubleshooting Steps
Look at the coordinator server.log to see more information about the connection. In the issue it appears to be network or DNS related. The actual error is an UnknownHostException, meaning Dremio cannot resolve the database server hostname. The relevant stack trace includes:
java.sql.SQLException: Cannot create PoolableConnectionFactory (The connection attempt failed.) ... Caused by: org.postgresql.util.PSQLException: The connection attempt failed. ... Caused by: java.net.UnknownHostException: <database-hostname>
- To test connectivity, the following command can be run on the co-ordinator.
curl -v <database-hostname>:5432
This checks if the database hostname resolves and if port 5432 is open.
Possible results include:
- "Could not resolve host" (name resolution failed)
- "Connection timed out" or "Network is unreachable" (port/firewall issue)
- "Connected to (IP_ADDRESS) port 5432" (successful resolution and open port)
Steps to Resolve
This error does not originate from Dremio itself. Dremio is attempting to connect to the database, but there could be network issues such as DNS resolution failing. Please engage with your network or infrastructure team to address any network issues between Dremio and the source .