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.
Here is how I configured the remote database server (where Host name/address is the Public IPv4 of my EC2 instance).
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:
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
Partial screenshot of /var/log/postgresql/postgresql-12-main.log
shows the following:
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.