Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-17675

Replication gives error when used along with artifactory plugin



    • Type: Improvement
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: 6.3.3
    • Fix Version/s: None
    • Component/s: Replication, User Plugins
    • Labels:
    • Environment:

      Ubuntu 16.04 (Xenial Xerus)


      We are having an issue in replication when we use the user plugin to perform a copy and start a pull replication. 

      Steps to reproduce :

      We need two artifactory instances with different license, to represent two different regions A and B.

      1. Installation:

      In Region A:

      a. Installed Artifactory v6.x
      b. Created a local repository: art1-docker-local-repodev
      c. Created a local repository: art1-docker-local-repotest

      In Region B:

      a. Installed Artifactory v6.x
      b. Created a local repository: art2-docker-local-repodev
      c. Created a local repository: art2-docker-local-repotest

      2. Repository Event Based Replication(Push) setup:

      From Region A (art1-docker-local-repodev) --> to Region B (art2-docker-local-repodev)
      From Region B(art2-docker-local-repotest) --> to Region A(art1-docker-local-repotest)

      3. Initiated a deploy and then a copy:

      a. Deploy artifacts to Region A (art1-docker-local-repodev), this triggers replication to art2-docker-local-repodev in Region B.
      b. In Region B, copied the artifacts, by using the storage plugin as mentioned in the wiki page : https://www.jfrog.com/confluence/display/RTF/User+Plugins#UserPlugins-Storage 

      Here is the plugin code used : 

      import org.artifactory.repo.RepoPathFactory

      storage {
      afterCreate { item ->
      if ("art2-docker-local-repodev".equals(item.getRepoKey())) {
      def fromRepoPath = RepoPathFactory.create(item.getRepoKey(), item.repoPath.path)
      def toRepoPath = RepoPathFactory.create("art2-docker-local-repotest", item.repoPath.path)

      log.error("[Copy Test] Copying $fromRepoPath to $toRepoPath")
      repositories.copy(fromRepoPath, toRepoPath)

      c. This gives an error saying "Refusing to queue replication event.... the target server...is equal to one of the origin" and fails to trigger a replication from Region B art2-docker-local-repotest to Region A art1-docker-local-repotest. This should have worked as the repositories are different. 


      Here's the corresponding log entry:

      2018-10-19 21:14:37,751 [http-nio-8081-exec-8] [DEBUG] (o.a.a.r.c.ReplicationServiceImpl:314) - Refusing to queue replication event for 'art2-docker-local-repotest:replication-test.rtf': the target server '7763f1f3d6fafb93:373c9a14:1668cfdcf37:-8000' is equal to one of the origin '[7763f1f3d6fafb93:373c9a14:1668cfdcf37:-8000, 83e357a425d9b387:51be598b:1668cffc856:-8000]' of this event.
      2018-10-19 21:14:37,751 [http-nio-8081-exec-8] [DEBUG] (o.a.a.r.c.p.e.EventQueue:189) - User plugin rejected replication of path art2-docker-local-repotest/replication-test.rtf to/from target


      Note: The copy plugin works as tested in this use case :

      Deploy a file to Region B (art2-docker-local-repodev) , this triggers the copy plugin and creates a copy in Region B (art2-docker-local-repotest), which in turn triggers the event replication and replicates the file to Region A(art1-docker-local-repotest). 





            prasannan Prasanna Narayana
            0 Vote for this issue
            1 Start watching this issue