0

I have a ThingsBoard Professional Edition setup using AWS EC2 instance. The database is PostgreSQL-12. I tend to get the following error: FATAL: password authentication failed for user "postgres" FATAL: password authentication failed for user "postgres" when trying to log into the remote database server on pgAdmin4.

Here is a screenshot of the error shown when attempting to log in to server created on pgAdmin4. Connect to server error
Here is how I configured the remote database server (where Host name/address is the Public IPv4 of my EC2 instance).
Create Server

In postgresql.conf, I have replaced the line listen_address='127.0.0.1' with listen_addresses='*'.
In pg_hba.conf, I added host all all 0.0.0.0/0 md5.
Here is a screenshot of my pg_hba.conf file:
pg_hba.conf
I have also set the password for the user 'postgres' using the psql command #\password.

Here is what is shown in thingboard.log when I run the command:
cat /var/log/thingsboard/thingsboard.log | grep ERROR log file

Partial screenshot of /var/log/postgresql/postgresql-12-main.log shows the following:
postgresql log

I constantly have to use #ALTER USER postgres PASSWORD ‘<password>’; to be able to overcome this error but the error tends to return when I restart my local Windows machine.

ta.ng
  • 55
  • 1
  • 8

1 Answers1

2

That must be done by some software other than PostgreSQL.

Configure logging by setting log_statement = 'ddl' in postgresql.conf and restarting the database. Then you can more easily figure out when and by which software your password gets changed.

Additionally, configure pg_hba.conf to not allow passwordless connections from anywhere, then change the password. You may see some component start to complain - that component may be at fault.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263