question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Postgres connection error

See original GitHub issue

While trying to connect to a Heroku Connect Postgres database I am getting the following error:

org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host "[my ip]", user "username", database "database", SSL off

I am running DBeaver 3.8.5 on Xubuntu 16.04.

I have tried the PostgreSQL and PostgreSQL (Generic) drivers, and same result. I can use the psql CLI client fine, and I can connect using HeidiSQL from my computer. I can connect successfully to a MySQL server.

Any help would be appreciated.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

80reactions
cjunge-workcommented, Jun 1, 2017

@lcustodio on the SSL page, set SSL mode: require and either leave the SSL Factory blank or use the org.postgresql.ssl.NonValidatingFactory

4reactions
cjunge-workcommented, Feb 2, 2017

Found the problem: Heroku Connect uses SSL. Enabling SSL for the connection is working fine! I guess psql/HeidiSQL were detecting that automatically?

Read more comments on GitHub >

github_iconTop Results From Across the Web

"psql: could not connect to server: Connection refused" Error ...
Step 1: edit file potgresql.conf · Step 2: edit file pg_hba.conf · Step 3: restart postgres server · Step 4: check postgres server...
Read more >
Documentation: 6.5: Client Connection Problems - PostgreSQL
Once you have a running postmaster, trying to connect to it with client applications can fail for a variety of reasons. The sample...
Read more >
Troubleshooting a failed connection | PostgreSQL 11 ...
Check whether the database name and the username are accurate. You may be requesting a service on one system when the database you...
Read more >
PostgreSQL psql: could not connect to server - nixCraft
Step # 1: Allow remote IP address to access PostgreSQL. You need to open file called /var/lib/pgsql/data/pg_hba. · Step # 2: Allow communication ......
Read more >
Fix PostgreSQL connection refused easily - Bobcares
At times, the restrictions placed by the server firewall can also trigger connection refused error. If the psql port 5432 is not open...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found