Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-19548

Unable to change public access for a repository on mirror

XMLWordPrintable

      Issue Summary

      When the public access is changed for a repository that is synced on mirror, the public access is not changed on mirror.

      Steps to Reproduce

      1. Setup a primary instance with feature.public.access=true in the properties file.
      2. Setup a mirror instance with 1 or more repositories. Wait for the sync process to finish.
      3. Go to Repository settings > Repository permissions > click "Allow public access to this repository" checkbox to enabled.
      4. Try to clone the repository from mirror using a user who doesn't have READ permission for the repository.

      Expected Results

      The repository should be accessed by the user.

      Actual Results

      The user gets the following error -

      The requested repository does not exist, or you do not have permission to
      access it. 

       

       

      The below warning and error is thrown in the application-bitbucket.log file on mirror when public access is changed :

      2024-07-31 13:12:20,531 WARN  [farm-operation-5] @18N57Y1x792x44x0 c.a.b.i.m.m.r.MirrorRepositoryService Repository with upstream ID 1 cannot be synced due to another repository with upstream ID 1 having same slug in the same project.
      2024-07-31 13:12:20,531 ERROR [farm-operation-5] @18N57Y1x792x44x0 c.a.b.i.m.m.f.MetadataSynchronizer [PROJECT_1/rep_1](1): failed to prepare local repository: Repository with upstream ID 2 cannot be synced due to 
      duplicate slug 
      2024-07-31 13:12:20,532 WARN  [farm-project-metadata-poller:thread-1] @18N57Y1x792x44x0 c.a.b.i.m.m.s.DefaultFarmMetadataOrchestrator [PROJECT_1/rep_1](1): Synchronization of repository on mirror farm is not done

      And in the farm vet - 

      2024-07-31 13:13:57,979 WARN  [farm-vet-4] @18N57Y1x793x74820793x25 c.a.b.i.m.m.r.MirrorRepositoryService Repository with upstream ID 1 cannot be synced due to another repository with upstream ID 1 having same slug in the same project.
      2024-07-31 13:13:57,980 ERROR [farm-vet-4] @18N57Y1x793x74820793x25 c.a.b.i.m.m.f.MetadataSynchronizer [PROJECT_1/rep_1](1): failed to prepare local repository: Repository with upstream ID 2 cannot be synced due to duplicate slug
      2024-07-31 13:13:57,980 WARN  [farm-vet-4] @18N57Y1x793x74820793x25 c.a.b.i.m.mirror.vet.DefaultFarmVet Failed to retrieve metadata for synchronization of repository with ID (1)
      java.lang.NullPointerException: repository
          at java.util.Objects.requireNonNull(Objects.java:228)
          at com.atlassian.bitbucket.internal.mirroring.mirror.sync.DefaultMirrorBranchHelper.getDefaultBranch(DefaultMirrorBranchHelper.java:36)
          at com.atlassian.bitbucket.internal.mirroring.mirror.repository.MirrorRepositoryService.getDefaultBranch(MirrorRepositoryService.java:134)
          at com.atlassian.bitbucket.internal.mirroring.mirror.vet.VetContext.lambda$isDefaultBranchChanged$1(VetContext.java:170)
          at java.util.Optional.map(Optional.java:215)
          at com.atlassian.bitbucket.internal.mirroring.mirror.vet.VetContext.isDefaultBranchChanged(VetContext.java:170)
          at com.atlassian.bitbucket.internal.mirroring.mirror.vet.VetContext.synchronizeMetadata(VetContext.java:150)
          at com.atlassian.bitbucket.internal.mirroring.mirror.vet.DefaultFarmVet$ServerUpstreamRepositoryHashesCallback.lambda$null$1(DefaultFarmVet.java:316)
          at java.util.HashMap.forEach(HashMap.java:1290)
          at com.atlassian.bitbucket.internal.mirroring.mirror.vet.DefaultFarmVet$ServerUpstreamRepositoryHashesCallback.lambda$synchronizeMetadata$2(DefaultFarmVet.java:314)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)
          at com.atlassian.sal.core.executor.ThreadLocalDelegateRunnable.run(ThreadLocalDelegateRunnable.java:34)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.lang.Thread.run(Thread.java:750)
          ... 1 frame trimmed

       

      Workaround

      Change the repository name temporarily and let it sync on mirror and then change the name back to original.

              mgoyal2@atlassian.com Manish
              mgoyal2@atlassian.com Manish
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: