An old Java webapp that I’ve inherited connects to a (dockerized) Postgres database, using a certain username olduser
. Since this username was the first name of the developer who is now long gone, I wanted to rename it to a technical user. First, I renamed the user within Postgres (to newuser
), which did not raise any errors. NB I renamed the existing user, I didn’t create a new one, and I didn’t change the password.
Next, I replaced all occurrences of olduser
in the Java project (XML etc.) with newuser
, and redeployed/restarted everything.
Now the log says:
ERROR [http-nio-8080-exec-4] (JDBCExceptionReporter.java:78) - FATAL: password authentication failed for user "newuser"
whereas before it was connecting fine with olduser
.
Any ideas what I did wrong?
3
As it turns out, re-entering the password of newuser
in Postgres solved the issue, even though I had not touched the password:
ALTER USER newuser WITH PASSWORD 'oldpassword';
4