Connection to :7432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

Samebug tips9

Check if ip adress is correct, if the port is correct, and if the server is up and running and waiting for connections. Also, check if there's no firewall blocking you and if your internet connection is working.


Check if your server (or a proxy server) is not going up and down. There might be something between a proxy and a client sending intermittent requests to non-functioning hosts as well. There might as well be too many requests in a short amount of time.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Stack trace

  • org.postgresql.util.PSQLException: Connection to :7432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl( at org.postgresql.core.ConnectionFactory.openConnection( at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>( at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>( at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>( at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>( at org.postgresql.jdbc4.Jdbc4Connection.<init>( at org.postgresql.Driver.makeConnection( at org.postgresql.Driver.connect( at java.sql.DriverManager.getConnection( at java.sql.DriverManager.getConnection( at org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD$$anonfun$getConnector$1.apply(JDBCRDD.scala:188) at org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD$$anonfun$getConnector$1.apply(JDBCRDD.scala:181) at org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD$.resolveTable(JDBCRDD.scala:121) at org.apache.spark.sql.execution.datasources.jdbc.JDBCRelation.<init>(JDBCRelation.scala:91) at org.apache.spark.sql.execution.datasources.jdbc.DefaultSource.createRelation(DefaultSource.scala:60) at org.apache.spark.sql.execution.datasources.ResolvedDataSource$.apply(ResolvedDataSource.scala:158) at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:119) at local_project.hawqload_0_1.HawqLoad.tJDBCInput_1Process( at at local_project.hawqload_0_1.HawqLoad.runJobInTOS( at local_project.hawqload_0_1.HawqLoad.main( Caused by: Connection timed out: connect at Method) at at at at at at at at org.postgresql.core.PGStream.<init>( at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl( ... 21 more

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Unknown visitor
Unknown visitorOnce,
Eric HendersonEric Henderson
39 times, last one
Unknown UserUnknown User
2 times, last one
6 times, last one
Unknown visitor
Unknown visitorOnce,
983 more bugmates