org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
via GitHub by rawlingsj

host port isnt set

,

Check if your MongoDB is available.

Solutions on the web

via JIRA by Charlie Sharpsteen, 1 year ago
Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
via JIRA by Charlie Sharpsteen, 1 year ago
Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
via Stack Overflow by Akshat
, 1 year ago
Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
via talendforge.org by Unknown author, 1 year ago
Connection to :7432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
via talendforge.org by Unknown author, 1 year ago
Connection to :7432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
via Stack Overflow by Michał
, 1 year ago
Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at org.postgresql.core.PGStream.(PGStream.java:60)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:101)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:64)
at org.postgresql.jdbc2.AbstractJdbc2Connection.(AbstractJdbc2Connection.java:136)
at org.postgresql.jdbc3.AbstractJdbc3Connection.(AbstractJdbc3Connection.java:29)
at org.postgresql.jdbc3g.AbstractJdbc3gConnection.(AbstractJdbc3gConnection.java:21)
at org.postgresql.jdbc4.AbstractJdbc4Connection.(AbstractJdbc4Connection.java:31)
at org.postgresql.jdbc4.Jdbc4Connection.(Jdbc4Connection.java:24)
at org.postgresql.Driver.makeConnection(Driver.java:410)
at org.postgresql.Driver.connect(Driver.java:280)
at java.sql.DriverManager.getConnection(DriverManager.java:571)
at java.sql.DriverManager.getConnection(DriverManager.java:187)
at clojure.java.jdbc.deprecated$get_connection.invoke(deprecated.clj:182)
at migratus.database$eval24631$fn__24632.invoke(database.clj:196)
at clojure.lang.MultiFn.invoke(MultiFn.java:227)
at migratus.core$migrate.invoke(core.clj:56)
at puppetlabs.rbac.db_utils$migrate_BANG_.invoke(db_utils.clj:37)
at puppetlabs.rbac.services.rbac$reify__22438$service_fnk__5284__auto___positional$reify__22445.init(rbac.clj:92)
at puppetlabs.trapperkeeper.services$eval5120$fn__5121$G__5112__5124.invoke(services.clj:12)
at puppetlabs.trapperkeeper.services$eval5120$fn__5121$G__5111__5128.invoke(services.clj:12)
at puppetlabs.trapperkeeper.internal$run_lifecycle_fn_BANG_.invoke(internal.clj:145)
at puppetlabs.trapperkeeper.internal$run_lifecycle_fns.invoke(internal.clj:173)
at puppetlabs.trapperkeeper.internal$build_app_STAR_$reify__5977.init(internal.clj:437)
at puppetlabs.trapperkeeper.internal$boot_services_STAR_$fn__5989.invoke(internal.clj:463)
at puppetlabs.trapperkeeper.internal$boot_services_STAR_.invoke(internal.clj:462)
at puppetlabs.trapperkeeper.core$boot_with_cli_data.invoke(core.clj:113)
at puppetlabs.trapperkeeper.core$run.invoke(core.clj:144)
at puppetlabs.trapperkeeper.core$main.doInvoke(core.clj:159)
at clojure.lang.RestFn.invoke(RestFn.java:457)
at clojure.lang.Var.invoke(Var.java:394)
at clojure.lang.AFn.applyToHelper(AFn.java:165)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.core$apply.invoke(core.clj:624)
at puppetlabs.trapperkeeper.main$_main.doInvoke(main.clj:7)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at puppetlabs.trapperkeeper.main.main(Unknown Source)

Users with the same issue

130 times, 12 hours ago
11 times, 1 day ago
26943 times, 2 days ago
4 times, 3 days ago
5 times, 3 days ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.