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

Error while syncing new forked repository on mirror

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: High High
    • 9.1.0, 9.0.2
    • 9.0.0
    • Smart Mirroring
    • None

      Issue Summary

      When a fork is created for a mirrored repository in a mirrored project, it doesn't get created on the mirrors immediately and hence not accessible from mirror.

      Steps to Reproduce

      1. Given a mirror instance with one or more projects setup.
      2. Choose a repository which is synced on mirror.
      3. Create a fork of this repository in a project that is synced on mirror.
      4. Go to repository clone dialog for the forked repository
      5. Try to clone the forked repository from mirror
      6. Push new changes in the forked repository.

      Expected Results

      • Repository clone dialog should show clone URL for mirror
      • Repository should be cloned from the mirror successfully.
      • New changes pushed to the repository should be synced on the mirror successfully without errors.

      Actual Results

      • Repository clone dialog doesn't show mirror URL.
      • Cloning repository from the mirror fails with "repository not found" error.
      • On pushing new changes to the repository, below exception is noticed on each mirror node in the farm and similar exception is noticed after frequent intervals - 
      2024-08-08 14:03:20,916 WARN  [farm-refchange-poller:thread-1] @J57KPXx843x7x0 c.a.b.i.m.m.f.q.FarmRequestRetryingProcessor Request DefaultFarmQueueRequest{value=FarmSynchronizationRequest{externalRepositoryId=2, type=incremental}, attempt=2} failed attempt 2/5 with message: [Exception while processing an event for repository with ID (2):] waiting 5082 ms before retrying
      com.atlassian.bitbucket.repository.NoSuchRepositoryException: A repository with ID '2' is not mirrored by this mirror server or the repository does not exist
              at com.atlassian.bitbucket.internal.mirroring.mirror.repository.MirrorRepositoryService.lambda$getMirrorRepository$7(MirrorRepositoryService.java:225)
              at com.atlassian.stash.internal.user.DefaultEscalatedSecurityContext.call(DefaultEscalatedSecurityContext.java:59)
              at com.atlassian.bitbucket.internal.mirroring.mirror.DefaultUpstreamUserHelper.performAsUpstreamUser(DefaultUpstreamUserHelper.java:93)
              at com.atlassian.bitbucket.internal.mirroring.mirror.repository.MirrorRepositoryService.lambda$getMirrorRepository$8(MirrorRepositoryService.java:209)
              at com.atlassian.sal.core.transaction.HostContextTransactionTemplate$1.doInTransaction(HostContextTransactionTemplate.java:21)
              at com.atlassian.stash.internal.sal.spi.HostContextAccessorImpl.doInTransaction(HostContextAccessorImpl.java:54)
              at jdk.internal.reflect.GeneratedMethodAccessor342.invoke(Unknown Source)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at jdk.proxy3/jdk.proxy3.$Proxy432.doInTransaction(Unknown Source)
              at com.atlassian.sal.core.transaction.HostContextTransactionTemplate.execute(HostContextTransactionTemplate.java:18)
              at jdk.internal.reflect.GeneratedMethodAccessor311.invoke(Unknown Source)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
              at jdk.proxy2/jdk.proxy2.$Proxy691.execute(Unknown Source)
              at jdk.internal.reflect.GeneratedMethodAccessor311.invoke(Unknown Source)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
              at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
              at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)
              at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)
              at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
              at jdk.proxy49/jdk.proxy49.$Proxy1395.execute(Unknown Source)
              at com.atlassian.bitbucket.internal.mirroring.mirror.repository.MirrorRepositoryService.getMirrorRepository(MirrorRepositoryService.java:206)
              at com.atlassian.bitbucket.internal.mirroring.mirror.farm.synchronization.FarmOrchestrator.lambda$orchestrateChanges$0(FarmOrchestrator.java:95)
              at com.atlassian.bitbucket.internal.mirroring.mirror.repository.DefaultRepositoryLockCallback.onLockSuccess(DefaultRepositoryLockCallback.java:45)
              at com.atlassian.bitbucket.internal.mirroring.mirror.repository.MirrorRepositoryLockService.performUsingLock(MirrorRepositoryLockService.java:45)
              at com.atlassian.bitbucket.internal.mirroring.mirror.farm.synchronization.FarmOrchestrator.orchestrateChanges(FarmOrchestrator.java:89)
              at com.atlassian.bitbucket.internal.mirroring.mirror.farm.FarmQueueProcessorWiring.lambda$refChangesQueueProcessor$1(FarmQueueProcessorWiring.java:50)

      Workaround

      Wait for the farm vet to run on the mirror which is 3 minutes by default and configured using plugin.mirroring.synchronization.interval=<MINUTES> property. After the farm vet is run once, the repository is created on the mirror and then it returns to it's normal state.

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

                Created:
                Updated:
                Resolved: