This occurs when you have a de-provisioned Hobby/Mini/Basic tier database but are still trying to connect to it. You can follow the below steps further:
-
You can check if you're using the correct database credentials while establishing a connection to the database by running
heroku pg:credentials:url -a <appname>
. More details here. -
On Hobby, Mini, and Basic databases, with every database maintenance event, your database credentials will rotate, making the old ones invalid. Check that your application is connecting to the database with the new credentials that Heroku will update in your attachment config vars.
-
Further, in case of any credential mismatch issues between your database and your appâs config vars, you can rotate your database credentials (heroku pg:credentials:rotate), as this rotation will cause your config vars to be updated again.
Reference article here