Why am I seeing `FATAL: role "xxx" is not permitted to log in ` error when trying to connect to a Heroku Postgres database (Hobby/Mini/Basic tier)?

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:

  1. 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.

  2. 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.

  3. 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

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support