Grafana: DB query error: PQ: password authentication failed for user "Postgres"

My grafana dashboard was earlier working fine and was showing charts and graphs while being linked to a Postgres DB. I had to add some environment variables and add some plugins. So I updated the grafana docker-compose file and added some extra env variables.

When I rebuild the docker container and ran the docker container, I got some errors. Although I was able to get the required changes in grafana and add the plugins, I had some issues with connecting with data sources.

Now I get the following error in data sources while connecting with postgres SQL.

db query error: pq: password authentication failed for user "postgres"

Earlier it was working fine. Now, how come it is having issues now? Am I doing something wrong? (Also, this change fine locally but not in production)

configuration in Data Sources

host: db:5432

Database: xxxx

User: postgres

password: xxxxx

Kindly help me in solving this issue.

Thanks

My grafana dashboard was earlier working fine and was showing charts and
graphs while being linked to a Postgres DB. I had to add some environment
variables and add some plugins. So I updated the grafana docker-compose
file and added some extra env variables.

There’s a lot of “some” in that description, with no detail about what
variables you defined (and why) or which plugins you added.

When I rebuild the docker container and ran the docker container, I got
some errors. Although I was able to get the required changes in grafana
and add the plugins, I had some issues with connecting with data sources.

Again, what were the “errors” and what are the “issues”?

Now I get the following error in data sources while connecting with
postgres SQL.

db query error: pq: password authentication failed for user "postgres"

So, the first question would be - can you connect manually (ie: using the
postgres command-line client) from the machine running Grafana, and using the
same credentials?

Antony.