DataGrip won't connect to AWS RDS (PostgreSQL) but psql works fine

Having some trouble getting DataGrip to connect on a fresh Mac install. The database is an AWS RDS PostgreSQL database.

With the same details used and defaults otherwise, DataGrip won't connect but the CLI tool, psql, works fine.

After some time I get the following stacktrace:

2018-10-19 11:15:21,978 [ 335318] WARN - lij.database.util.ErrorHandler - java.rmi.ConnectException: Connection refused to host:; nested exception is: Connection refused (Connection refused)

java.lang.RuntimeException: java.rmi.ConnectException: Connection refused to host:; nested exception is: Connection refused (Connection refused)

  at com.intellij.util.ExceptionUtil.rethrow(

  at com.intellij.util.ExceptionUtil.rethrowAllAsUnchecked(

  at com.intellij.database.dataSource.DatabaseConnectionManager$Executor.createInner(

  at com.intellij.database.dataSource.DatabaseConnectionManager$Executor.lambda$sync$2(

  at com.intellij.database.dataSource.AsyncUtil.withAsyncFriendly(

  at com.intellij.database.dataSource.DatabaseConnectionManager$Executor.sync(

  at com.intellij.database.dataSource.DatabaseConnectionManager$Builder.sync(

  at com.intellij.database.dataSource.DataSourceSyncManager.lambda$static$1(

  at com.intellij.database.dataSource.DataSourceSyncManager$SyncProcessor$1.perform(

  at com.intellij.database.dataSource.DatabaseModelLoader$IntrospectionSession.updateDatabaseInfo(

  at com.intellij.database.dataSource.DatabaseModelLoader$

  at com.intellij.database.dataSource.DataSourceSyncManager$SyncProcessor.performSync(

  at com.intellij.database.dataSource.AsyncUtil.lambda$null$6(

  at com.intellij.database.dataSource.AsyncUtil.lambda$underProgress$14(

  at com.intellij.openapi.progress.impl.CoreProgressManager.a(

  at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(

  at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(

  at com.intellij.database.dataSource.AsyncUtil.underProgress(

  at com.intellij.database.dataSource.AsyncUtil.underProgress(

  at com.intellij.database.dataSource.AsyncUtil.lambda$captureIndicator$7(

  at java.util.concurrent.CompletableFuture$

  at com.intellij.openapi.application.impl.ApplicationImpl$

  at java.util.concurrent.Executors$


  at java.util.concurrent.ThreadPoolExecutor.runWorker(

  at java.util.concurrent.ThreadPoolExecutor$

Not sure why it's trying to connect to This isn't what the hostname is set to. I tried using the DB's IP address unless there was some weird DNS issues but it still has the same problem.
Any ideas would be appreciated.
Comment actions Permalink

Is it still happening?

If yes, please send logs to

Comment actions Permalink

I am experiencing a similar issue where DataGrip won't connect to Snowflake and is producing the following errors.

java.rmi.ConnectException: Connection refused to host:; nested exception is: Connection refused: connect

We are specifying the Snowflake host identifier in the DataGrip hosts field (not in the connection properties, so why is it trying to connect to

If we are supposed to send the logs to, how do we generate the logs to send to this email address?


Pat B.

Comment actions Permalink

It is needed to generate two type of logs: 
1. General logs with IDE version, driver version and so on (Help | Collect Logs and Diagnostic Data)

2. SQL logs (Help | Show SQL Logs in Finder) 

Both of them are better to be generated right after reproducing the case. 

You can either send them by the mentioned email, or upload them to and tell us the upload ID. 

BTW, it is 2018 year in the provided logs. Is it intended? As a general troubleshooting step, I'd set the time. There are a lot of places in the system where time differences could cause problems. 


Please sign in to leave a comment.