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: 127.0.0.1; nested exception is:

  java.net.ConnectException: Connection refused (Connection refused)

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

  java.net.ConnectException: Connection refused (Connection refused)

  at com.intellij.util.ExceptionUtil.rethrow(ExceptionUtil.java:160)

  at com.intellij.util.ExceptionUtil.rethrowAllAsUnchecked(ExceptionUtil.java:166)

  at com.intellij.database.dataSource.DatabaseConnectionManager$Executor.createInner(DatabaseConnectionManager.java:371)

  at com.intellij.database.dataSource.DatabaseConnectionManager$Executor.lambda$sync$2(DatabaseConnectionManager.java:325)

  at com.intellij.database.dataSource.AsyncUtil.withAsyncFriendly(AsyncUtil.java:161)

  at com.intellij.database.dataSource.DatabaseConnectionManager$Executor.sync(DatabaseConnectionManager.java:322)

  at com.intellij.database.dataSource.DatabaseConnectionManager$Builder.sync(DatabaseConnectionManager.java:139)

  at com.intellij.database.dataSource.DataSourceSyncManager.lambda$static$1(DataSourceSyncManager.java:43)

  at com.intellij.database.dataSource.DataSourceSyncManager$SyncProcessor$1.perform(DataSourceSyncManager.java:271)

  at com.intellij.database.dataSource.DatabaseModelLoader$IntrospectionSession.updateDatabaseInfo(DatabaseModelLoader.java:314)

  at com.intellij.database.dataSource.DatabaseModelLoader$IntrospectionSession.run(DatabaseModelLoader.java:297)

  at com.intellij.database.dataSource.DataSourceSyncManager$SyncProcessor.performSync(DataSourceSyncManager.java:273)

  at com.intellij.database.dataSource.AsyncUtil.lambda$null$6(AsyncUtil.java:58)

  at com.intellij.database.dataSource.AsyncUtil.lambda$underProgress$14(AsyncUtil.java:130)

  at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:580)

  at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:525)

  at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:85)

  at com.intellij.database.dataSource.AsyncUtil.underProgress(AsyncUtil.java:136)

  at com.intellij.database.dataSource.AsyncUtil.underProgress(AsyncUtil.java:130)

  at com.intellij.database.dataSource.AsyncUtil.lambda$captureIndicator$7(AsyncUtil.java:58)

  at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)

  at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)

  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

  at java.util.concurrent.FutureTask.run(FutureTask.java:266)

  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

  at java.lang.Thread.run(Thread.java:745)
 
Not sure why it's trying to connect to 127.0.0.1? 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.
3
3 comments

Is it still happening?

If yes, please send logs to maxim.sobolevskiy@jetbrains.com

0

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: 127.0.0.1; nested exception is: java.net.ConnectException: Connection refused: connect

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

If we are supposed to send the logs to maxim.sobolevskiy@jetbrains.com, how do we generate the logs to send to this email address?

Thanks,

Pat B.

0

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 https://uploads.jetbrains.com/ 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. 

0

Please sign in to leave a comment.