Answers for "sequalize postgres heroku no pg_hba.conf entry for host error"

0

sequalize postgres heroku no pg_hba.conf entry for host error

const Sequelize = require('sequelize');

const sequelize = new Sequelize({
    database: process.env.POSTGRES_DB,
    username: process.env.POSTGRES_USER,
    password: process.env.POSTGRES_PASSWORD,
    host: process.env.POSTGRES_HOST,
    port: process.env.POSTGRES_PORT,
    dialect: "postgres",
    dialectOptions: {
        ssl: {
            require: true,
            rejectUnauthorized: false
        }
     },
});
Posted by: Guest on October-26-2021
-1

no pg_hba.conf entry for host heroku

"FATAL: no pg_hba.conf entry for host" errors indicate that there was a failed authentication attempt to the database, so the connection couldn't be established. This can happen because of different reasons:

The authentication failed because the user/password credentials were invalid: ((user "xxxx", database "yyyy")). This could happen if you're trying to connect to the database using wrong or revoked credentials. (See also: Why am I seeing connection errors for my Heroku Postgres database from an unexpected IP address?).

The authentication failed because the connection didn't use SSL encryption: (SSL off). All Heroku Postgres production databases require using SSL connections to ensure that communications between applications and the database remain secure. If your client is not using SSL to connect to your database, you would see these errors even if you're using the right credentials to connect to it.
Posted by: Guest on February-23-2021

Code answers related to "sequalize postgres heroku no pg_hba.conf entry for host error"

Browse Popular Code Answers by Language