Details
Description
Summary
If an instance has missing repositories, when integrity checks attempt to recreate them the processing attempts to remove each created repository from its list of repositories to recreate. However, that list is immutable, so the processing fails.
Steps to Reproduce
- Restore a partial backup, or a backup taken without locking both the database and filesystem to ensure consistency, such that the database includes repositories that are not present in the restored home directory
- Run integrity checks
Expected Results
Missing repositories are recreated on disk without error.
Actual Results
Missing repositories are not recreated, and the following error is logged in atlassian-bitbucket.log:
2019-03-15 16:34:04,840 ERROR [Caesium-1-3] c.a.s.i.i.DefaultIntegrityCheckReporter Failed to create missing repositories. java.lang.UnsupportedOperationException: null at com.google.common.collect.ImmutableList.remove(ImmutableList.java:536) at com.atlassian.stash.internal.integrity.RepositoryIntegrityHelper.lambda$createMissingRepositories$9(RepositoryIntegrityHelper.java:177) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) at com.atlassian.stash.internal.integrity.RepositoryIntegrityHelper.createMissingRepositories(RepositoryIntegrityHelper.java:157) at com.atlassian.stash.internal.integrity.DefaultIntegrityCheckService.checkRepositories(DefaultIntegrityCheckService.java:136) at com.atlassian.stash.internal.integrity.FullIntegrityCheckHelper.checkAllRepositories(FullIntegrityCheckHelper.java:63) at com.atlassian.stash.internal.integrity.FullIntegrityCheckHelper.runAndReport(FullIntegrityCheckHelper.java:73) at com.atlassian.stash.internal.integrity.FullIntegrityCheckHelper.runChecks(FullIntegrityCheckHelper.java:42) at com.atlassian.stash.internal.integrity.FullIntegrityCheckHelper$$FastClassBySpringCGLIB$$aec74624.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at com.atlassian.stash.internal.integrity.FullIntegrityCheckHelper$$EnhancerBySpringCGLIB$$89240ff8.runChecks(<generated>) at com.atlassian.stash.internal.integrity.FullIntegrityCheckStartupTask$FullIntegrityCheckJobRunner.lambda$runJob$0(FullIntegrityCheckStartupTask.java:119) at com.atlassian.stash.internal.user.DefaultEscalatedSecurityContext.call(DefaultEscalatedSecurityContext.java:58) at com.atlassian.stash.internal.integrity.FullIntegrityCheckStartupTask$FullIntegrityCheckJobRunner.runJob(FullIntegrityCheckStartupTask.java:118) at com.atlassian.scheduler.core.JobLauncher.runJob(JobLauncher.java:134)
Workaround
There are no workarounds for this issue.
Attachments
Issue Links
- is a regression of
-
BSERV-11492 Repository Integrity Checks will always fail to restore missing repositories
- Closed