UnknownHostException when trying to register a data source using PostgreSQL
Hello community,
I’m currently trying to register a Data Source using my own PostgreSQL JDBC and I have followed the exact steps on the documentation page and am getting this error on the Jobserver:
org.postgresql.util.PSQLException: The connection attempt failed.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:331)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
at org.postgresql.jdbc.PgConnection.(PgConnection.java:247)
at org.postgresql.Driver.makeConnection(Driver.java:434)
at org.postgresql.Driver.connect(Driver.java:291)
at org.apache.spark.sql.execution.datasources.jdbc.DriverWrapper.connect(DriverWrapper.scala:45)
at com.collibra.jobserver.CollibraDriverWrapper.connect(CollibraDriverWrapper.java:48)
at com.collibra.jdbc.connection.DefaultConnectionProvider.getConnection(DefaultConnectionProvider.java:30)
at com.collibra.jdbc.connection.ConnectionProviderChainImpl.getConnection(ConnectionProviderChainImpl.java:35)
at com.collibra.jdbc.connection.batched.BatchedConnectionProvider.getConnection(BatchedConnectionProvider.java:22)
at com.collibra.jdbc.connection.ConnectionProviderChainImpl.getConnection(ConnectionProviderChainImpl.java:35)
at com.collibra.jdbc.connection.pathresolver.PathResolverConnectionProvider.getConnection(PathResolverConnectionProvider.java:58)
at com.collibra.jdbc.connection.ConnectionProviderChainImpl.getConnection(ConnectionProviderChainImpl.java:35)
at com.collibra.jdbc.connection.test.TestConnectionProvider.getConnection(TestConnectionProvider.java:55)
at com.collibra.jdbc.connection.ConnectionProviderChainImpl.getConnection(ConnectionProviderChainImpl.java:35)
at com.collibra.jobserver.job.catalog.JdbcHelper$.getConnection(JdbcHelper.scala:198)
at com.collibra.jobserver.job.catalog.JdbcConnectionTestJob.runJob(DataIngestionJob.scala:267)
at com.collibra.jobserver.job.catalog.JdbcConnectionTestJob.runJob(DataIngestionJob.scala:251)
at com.collibra.jobserver.job.AbstractJob.runJob(AbstractJob.scala:35)
at com.collibra.jobserver.job.AbstractJob.runJob(AbstractJob.scala:19)
at spark.jobserver.JobManagerActor.$anonfun$getJobFuture$1(JobManagerActor.scala:647)
at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:659)
at scala.util.Success.$anonfun$map$1(Try.scala:255)
at scala.util.Success.map(Try.scala:213)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:292)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:33)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:33)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.net.UnknownHostException: XXXXXXX (replacing the host name here)
at java.base/java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.base/java.net.SocksSocketImpl.connect(Unknown Source)
at java.base/java.net.Socket.connect(Unknown Source)
at org.postgresql.core.PGStream.createSocket(PGStream.java:241)
at org.postgresql.core.PGStream.(PGStream.java:98)
at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:109)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:235)
This is a screenshot of the error in the Collibra interface:
I know I am using the correct credentials for the database connection because I use them in multiple other instances with the exact same connection string and am able to connect to the database without issue, so I am a bit confused as to why this error is happening. The PostgreSQL driver version is 42.5.1 and I set the JDBC up using the exact documentation on the productresources site (Connection: jdbc:postgresql://$host:$port/$database | Driver Class Name: org.postgresql.Driver with the same labels and properties as they are on the site). Any suggestions or pointers in the right direction as to why this may be happening would be greatly appreciated!