4

Heroku is hosting my node.js API and the PostgreSQL addon is responsible for my DB.

I recently upgraded my heroku db plan from hobby-dev to standard-0 and got some issues with SSL connection. After setting sslmode=require, my new DB was performing with no problems and I was really happy with it.

Suddenly, without any changes in code, nor in environment config vars and in a day with a reduced request flow, it started to print on PaperTrail the following error:

[COBALT] [10-1] sql_error_code = 28000 FATAL: no pg_hba.conf entry for host "xx.xxx.xx.xxx", user "postgres", database "postgres", SSL off

Even when my node.js API is not requested, this error gets printed. I'm intrigued with the credentials user "postgres", database "postgres", my DB in which the API stores requests, responses and some useful data has other credentials.

The API is working fine, but these logs are really pissing me off and I have no idea what is going on.

Any ideas?

Andre Amaral
  • 41
  • 1
  • 4
  • Something probably was changed after all. This is the general purpose "cannot connect" message. Look into the PostgreSQL log file for details. – Laurenz Albe Mar 07 '19 at 15:46

2 Answers2

1

For those that land here from seeing this log message -- FATAL: no pg_hba.conf entry.

Mgan
  • 21
  • 1
  • 3
0

I am extremely green. I just started coding 5 months ago. While working on a school assignment, I encountered the same issue. Near identical situation to that outlined in the OP. I ended up finding my solution. I found a spelling error in my code here. But It seems that error is related to ssl.

const sequelize = new Sequelize(CONNECTION_STRING, {
    dialect:"postgres", 
    dialectOptions: {
        ssl: {
            rejectUnauthorized: false
        }
    }
})
Yëco
  • 1,546
  • 15
  • 16