Restore fails with password authentication failed for user
症状
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 stash-20140111-231408-003.tar to /opt/stash-home
2014-01-11 23:31:21,378 INFO Validating database before restore
2014-01-11 23:31:21,718 ERROR stash-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 "stashuser"
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.postgresql.util.PSQLException: FATAL: password authentication failed for user "stashuser"
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) ~[spring-jdbc-3.2.4.RELEASE.jar:3.2.4.RELEASE]
at com.atlassian.stash.internal.db.DefaultDatabaseValidator.validate(DefaultDatabaseValidator.java:35) ~[stash-dao-impl-2.9.0-m2.jar:na]
... 7 more frames available in the log file
原因
The new database you are trying to restore Stash into was created with a different username/password from the previous database
ソリューション
The backup client needs the new database to be totally clean and configured just like the first installation of Stash as described on each of different database types of the Connecting Stash to an external database document.
If you are restoring Stash 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 Restoring Stash into a DB are passed during the restore.