- Más nuevo
- Más votos
- Más comentarios
"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.
-
The authentication failed because the connection didn't use SSL encryption: (SSL off). 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.
-
The authentication failed because the client environment had previously been configured for certificate-based Postgres authentication (mTLS) but the current server is not configured for certificate-based authentication. Look for a .postgresql subdirectory in your current user HOME directory and remove or rename any postgresql.crt subdirectory in there.
Try sudo find / -type f -name pg_hba.conf
Hi there, I have the same problem, but my backend application is in NestJS and dockerized. I have NO problem accessing Postgres RDS from EC2, however, I kept having an error of "FATAL: no pg_hba.conf entry for host, no encryption" in docker shell.
I already have tried the way to fix that you commented above, I guess pg_hba.conf file is not dockerized with backend app?
PLEASE help me out as I couldn't process my project for three days now...
Contenido relevante
- OFICIAL DE AWSActualizada hace un año
- OFICIAL DE AWSActualizada hace 2 años
- OFICIAL DE AWSActualizada hace un año
- OFICIAL DE AWSActualizada hace 4 meses
thank you. I had to add ssl=true.
I am now getting a new error
node:internal/process/promises:288 triggerUncaughtException(err, true /* fromPromise */); ^
Error: connect ECONNREFUSED 127.0.0.1:5432 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1300:16) { errno: -111, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 5432 }
If you perform a
netstat -an
can you see postgress listening on the loopback address?This doc may help a little more. https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/PostgreSQL.Concepts.General.SSL.html