Uploaded image for project: 'Bitbucket Server'
  1. Bitbucket Server
  2. BSERV-11677

Repository Integrity Checks fail to create missing repositories

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: 5.16.3, 6.0.3, 6.1.2
    • Fix Version/s: 6.2.0, 5.16.4, 6.0.4, 6.1.3
    • Component/s: None
    • Labels:
      None

      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

            Activity

              People

              Assignee:
              bturner Bryan Turner
              Reporter:
              bturner Bryan Turner
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: