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

Properties unable to replicate between Artifactory when event based replications enabled

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: 6.10.0
    • Fix Version/s: None
    • Component/s: Replication
    • Labels:
      None
    • Environment:

      Description

      Steps to reproduce: 

      1) Set replication between two Artifactory local repositories. For example:- Consider docker-local repository in Artifactory-1 and set Replication to the docker-local repository of Artifactory-2 (by going to Admin tab --> Local --> Replications of Artifactory-1 docker-local repository).

      2) Check "Enable Event Replication" and save the configuration.

      3) Now go to Artifactory-1 Terminal, Add the below plugin in Artifactory-1 under $Artifactory_Home/etc/plugins/

      import org.artifactory.repo.RepoPath

      replication {

        beforeFileReplication { localRepoPath ->

        if (repositories.exists(localRepoPath)){

           repositories.setProperty(localRepoPath,"foo","bar");

           log.warn(localRepoPath);

      log.error(localRepoPath);

        }

      else {

      log.warn("Does not exist");

      }

        }

      }

      By adding that plugin, when replication is enabled, Artifactory set properties to the artifacts with key value as foo, bar  and then push the artifacts to the other Artifactory node-2.

      4) Reload the plugins using the below curl command:

      curl -uadmin:password -XPOST http://<Artifactory_Url>/artifactory/api/plugins/reload

       

      5) Deploy an Artifact to the Artifactory-1 docker-local repository and we see the following errors in the Artifactory-1 logs:

      2019-05-17 00:37:42,530 [http-nio-8081-exec-8] [INFO ] (o.a.e.UploadServiceImpl:386) - Deploy to 'docker-local:source.png' Content-Length: 509512
      2019-05-17 00:37:45,560 [http-nio-8081-exec-8] [WARN ] (replication :9) - docker-local:source.png
      2019-05-17 00:37:45,561 [http-nio-8081-exec-8] [ERROR] (replication :10) - docker-local:source.png
      2019-05-17 00:37:45,563 [http-nio-8081-exec-8] [WARN ] (o.a.s.f.l.SessionLockEntry:120) - Mutable item 'docker-local:source.png' has local modifications that will be discarded.
      2019-05-17 00:37:45,563 [http-nio-8081-exec-8] [ERROR] (o.s.t.s.TransactionSynchronizationUtils:171) - TransactionSynchronization.afterCompletion threw exception
      java.util.ConcurrentModificationException: null

      6) Artifacts get deployed in Artifactory-1 and will be pushed to Artifactory-2 repository (as we enabled event based replication) but the properties were not set for the artifacts for both source and target Artifacts (which means the groovy plugin failed to set the property for the artifacts)

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            santhoshp Santhosh Pesari
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: