1

anyone facing something similar? sadly I'm on a free plan so I can't open a ticket... does anyone know of a way to restart the service/machine of the DB? maybe that would just solve it...

aynber
  • 22,380
  • 8
  • 50
  • 63
Eyal Elkevity
  • 69
  • 1
  • 7
  • Are you using the `DATABASE_URL` environment variable every time you connect? Your connection string may have changed. – ChrisGPT was on strike Dec 16 '21 at 12:17
  • 1
    It is usually a good idea to read what the error message says. And if asking someone for help, to quote the error message to them too. We can't explain it to you if we don't know what it is. – jjanes Dec 16 '21 at 20:50
  • yes you are right @jjanes I forgot to mention the error message - it was simple connection timeout. but anyways I posted my answer below, in my case after heroku performed the maintenance the connection params had changed... thanks for the quick comment! – Eyal Elkevity Dec 17 '21 at 13:02
  • had the exactly same issue, did you solve it? – Yang Apr 10 '22 at 14:52

3 Answers3

1

Yes, Im in the same situation. Heroku are a bunch of amateurs. They did some maintenance on the DB, and after it was done, credentials don't work, even those listed in admin/dashboard section of web. Bunch of loosers... @heroku

J S
  • 11
  • 1
0

ok so the issue in my case is that indeed heroku performed some sort of maintenance on the DB, and apparently it's connection params (host/url/user/password) had changed... and since it was embedded throughout all my interfaces (the app, my db tools, admin app I also have) - none were able to connect (they'd timeout).

while trying to figure out, I used the wonderful CLI tools of heroku pg:info and heroku pg:diagnose and even heroku pg:psql and tested to see that my data is still there... eventually I went to the online admin and that's where I saw the connections params had changed. BTW - I have this project for 2 years and this is the first time this had happened...

Eyal Elkevity
  • 69
  • 1
  • 7
0

I was in the same situation. Heroku will email you that your database is scheduled for maintenance. After it's complete, connecting to the database fails because of this error:

error: no pg_hba.conf entry for host "IP_ADDRESS", user "DB_USER", database "DB_NAME", no encryption

This is telling us that incorrect credentials were given, meaning the database connection string has changed. I first checked the credentials on the website for the Heroku Postgres Add-on (data.heroku.com), but the connection string was still the same as before; it has not updated or changed at all, therefore this was misleading. Instead, the updated connection string is found inside of the DATABASE_URL config variable, located in the Settings tab of your app on the Heroku dashboard (dashboard.heroku.com), under Config Vars. To avoid manually correcting this problem again, get the connection string from the DATABASE_URL config variable directly, as opposed to hard coding it in your app.

1mp
  • 1
  • 1