Deploy module uses two types of replication: Internal replication - the replicator is provided by Workspace + Replication modules and External replication - the replicator is provided by Relaxed module + relaxedws/replicator library.
Important: When the Relaxed module is enabled the External replicator will take over the Internal replicator because the external one has an higher priority (this is how it works and should work by design).
After introducing replication filters in #2710947: Support replication filters and #2749167: Support ReplicationTask the external replication doesn't work because of the incompatibility between Drupal\replication\ReplicationTask\ReplicationTask provided by Replication module and the Relaxed\Replicator\ReplicationTask provided by relaxedws/replicator library.
The error:
TypeError: Argument 3 passed to Relaxed\Replicator\Replicator::__construct() must be an instance of Relaxed\Replicator\ReplicationTask, instance of Drupal\replication\ReplicationTask\ReplicationTask given, called in /var/www/drupal8dev/modules/relaxed/src/CouchdbReplicator.php on line 47 in Relaxed\Replicator\Replicator->__construct() (line 31 of /var/www/drupal8dev/vendor/relaxedws/replicator/src/Replicator.php)
#0 /var/www/drupal8dev/modules/relaxed/src/CouchdbReplicator.php(47): Relaxed\Replicator\Replicator->__construct(Object(Doctrine\CouchDB\CouchDBClient), Object(Doctrine\CouchDB\CouchDBClient), Object(Drupal\replication\ReplicationTask\ReplicationTask))
#1 /var/www/drupal8dev/modules/workspace/src/ReplicatorManager.php(159): Drupal\relaxed\CouchdbReplicator->replicate(Object(Drupal\workspace\Entity\WorkspacePointer), Object(Drupal\workspace\Entity\WorkspacePointer), Object(Drupal\replication\ReplicationTask\ReplicationTask))
#2 /var/www/drupal8dev/modules/workspace/src/ReplicatorManager.php(140): Drupal\workspace\ReplicatorManager->doReplication(Object(Drupal\workspace\Entity\WorkspacePointer), Object(Drupal\workspace\Entity\WorkspacePointer), Object(Drupal\replication\ReplicationTask\ReplicationTask))
#3 /var/www/drupal8dev/modules/workspace/src/ReplicatorManager.php(70): Drupal\workspace\ReplicatorManager->update(Object(Drupal\workspace\Entity\WorkspacePointer), Object(Drupal\workspace\Entity\WorkspacePointer), Object(Drupal\replication\ReplicationTask\ReplicationTask))
Steps to reproduce the bug:
1) Enable Relaxed and Deploy modules (do all configuration, download composer dependences).
2) Create a node on Live workspace.
3) Replicate the content to the Stage workspace. Replication will fail with the error mentioned above.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 2796947.patch | 1.01 KB | josephdpurcell |
| #3 | replicationtask_object-2796947-2.patch | 672 bytes | radubutco |
Comments
Comment #2
radubutco commentedI've moved this into Replication because the problem is in the Replication module.
Comment #3
radubutco commentedThe patch fix the ReplicationTask class to extend the Relaxed\Replicator\ReplicationTask.
Comment #5
jeqq commentedThank you Radu!
Comment #6
josephdpurcell commentedI'm setting this back to Needs Work. Here's why:
You will see this error triggered:
Recommended Resolution
The order of dependencies is Relaxed depends on Workspace depends on Replication. The interface, then, that should be complied with is ReplicationTask, not RelaxedReplicationTask. The RelaxedReplicationTask is for the PHP CouchDB implementation, which has a different use case than ReplicationTask, particularly the fact Replication is not a CouchDB implementation, it only mimicks it.
Given that, I suggest:
Comment #7
josephdpurcell commentedThis patch removes the dependency on Relaxed in ReplicationTask.
It also adds a @todo for the drush.inc to either be moved to Relaxed or revised to not be dependent upon Relaxed.
Comment #8
josephdpurcell commentedSetting to critical bug since the module is unusable until this is resolved.
Comment #9
josephdpurcell commentedHmm, the patch didn't submit. Adding it again.
Comment #11
jeqq commentedThank you Joseph! I've missed the fact that Relaxed is not a dependence for Replication.