Restore fails with password authentication failed for user
Symptoms
Restore can't be executed. The following appears in the <path/to/backup/client>/log/atlassian-sbc-YYYY-MM-DD-HHMM.log:
2014-01-11 23:25:11,785 INFO Initializing
2014-01-11 23:25:15,130 INFO Unpacking bitbucket-20140111-231408-003.tar to /opt/bitbucket-home
2014-01-11 23:31:21,378 INFO Validating database before restore
2014-01-11 23:31:21,718 ERROR bitbucket-20140111-231408-003.tar could not be restored. Reason: Could not get JDBC Connection; nested exception is org.postgresql.util.PSQLException: FATAL: password authentication failed for user "bitbucketuser"
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.postgresql.util.PSQLException: FATAL: password authentication failed for user "bitbucketuser"
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) ~[spring-jdbc-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at com.atlassian.bitbucket.internal.db.DefaultDatabaseValidator.validate(DefaultDatabaseValidator.java:35) ~[bitbucket-dao-impl-2.9.0-m2.jar:na]
... 7 more frames available in the log file
Cause
The new database you are trying to restore Bitbucket Server into was created with a different username/password from the previous database
Resolution
The backup client needs the new database to be totally clean and configured just like the first installation of Bitbucket Server as described on each of different database types of the Connect Bitbucket to an external database document.
If you are restoring Bitbucket Server to a new database and you have different user/password, please make sure you specify the jdbc.override
parameter and all the other jdbc
parameters as described in 2023-10-24_01-30-41_Bitbucket Server Backup Client are passed during the restore.