Highlighted

Users reverse replication

Avatar

Avatar

shubhamg9400285

Avatar

shubhamg9400285

shubhamg9400285

06-05-2019

How can be reverse replicate users created on publish environment to author environment?

I tried to create workflow launchers for Reverse replication workflow on event "node created" of type "rep:user" but workflow is failing.

AEM 6.4

I am getting this workflow exception

com.adobe.granite.workflow.WorkflowException: Process execution resulted in an error

at com.adobe.granite.workflow.core.job.HandlerBase.executeProcess(HandlerBase.java:204)

at com.adobe.granite.workflow.core.job.JobHandler.process(JobHandler.java:261)

at org.apache.sling.event.impl.jobs.JobConsumerManager$JobConsumerWrapper.process(JobConsumerManager.java:502)

at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.startJob(JobQueueImpl.java:293)

at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.access$100(JobQueueImpl.java:60)

at org.apache.sling.event.impl.jobs.queues.JobQueueImpl$1.run(JobQueueImpl.java:229)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused by: com.adobe.granite.workflow.WorkflowException: Failed to execute process

at com.day.cq.workflow.compatibility.CQWorkflowProcessRunner.execute(CQWorkflowProcessRunner.java:108)

at com.adobe.granite.workflow.core.job.HandlerBase.executeProcess(HandlerBase.java:194)

... 8 more

Caused by: com.day.cq.workflow.WorkflowException: javax.jcr.PathNotFoundException: /home/users/community/c/EN1McTKEo6NWDyHWaf_Z

at com.day.cq.wcm.workflow.process.ReplicatePageProcess.execute(ReplicatePageProcess.java:211)

at com.day.cq.workflow.compatibility.CQWorkflowProcessRunner.execute(CQWorkflowProcessRunner.java:93)

... 9 more

Caused by: javax.jcr.PathNotFoundException: /home/users/community/c/EN1McTKEo6NWDyHWaf_Z

at org.apache.jackrabbit.oak.jcr.session.SessionImpl.getItem(SessionImpl.java:362)

at com.adobe.granite.repository.impl.CRX3SessionImpl.getItem(CRX3SessionImpl.java:168)

at com.day.cq.wcm.workflow.process.ReplicatePageProcess.execute(ReplicatePageProcess.java:176)

... 10 more

Replies

Highlighted

Avatar

Avatar

berliant

Employee

Avatar

berliant

Employee

berliant
Employee

06-05-2019

In order to workaround the error, you can try to exclude /home/users/community from your workflow launch configuration or add sufficient permissions to /home/users/community for workflow-service account.

Highlighted

Avatar

Avatar

BrijeshYadav

Avatar

BrijeshYadav

BrijeshYadav

06-05-2019

I haven't implemented this yet but came across documentation.


Sling distribution is more appropriate for user synchronization.

User Synchronization

Highlighted

Avatar

Avatar

shubhamg9400285

Avatar

shubhamg9400285

shubhamg9400285

06-05-2019

Hi Brijesh,

Thanks for your reply but in the same article  following is writter

" As of AEM 6.1, when user synchronization is enabled, user data is automatically synchronized across the publish instances in the farm and are not created on author."

So doesnt it means user sync works only among publish environments and not from publish to author.

Highlighted

Avatar

Avatar

BrijeshYadav

Avatar

BrijeshYadav

BrijeshYadav

06-05-2019

My bad I did not read your question clearly.

Sling distribution is only to synch users among multiple publishers

Highlighted

Avatar

Avatar

shubhamg9400285

Avatar

shubhamg9400285

shubhamg9400285

06-05-2019

Hi i gave all required permissions now workflow is not throwing any error and it is getting completed successfully but user is still not getting replicated to author.

1747397_pastedImage_0.png

1747395_pastedImage_1.png

Highlighted

Avatar

Avatar

jbrar

Employee

Avatar

jbrar

Employee

jbrar
Employee

06-05-2019

On the communities console in author, You can go to the member's tab and it will show you all the users on author. It uses a tunnel service to get users from publish instance.

So, instead of using reverse replication, you can leverage the Tunnel service feature. Check the "Tunnel Service on Author" at [1]

[1] Deploying Communities

Screen Shot 2019-05-06 at 1.28.26 PM.png

Highlighted

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Answer

2.3K
smacdonald2008

06-05-2019

Users should be created on AUTHOR before Publish.

Highlighted

Avatar

Avatar

shubhamg9400285

Avatar

shubhamg9400285

shubhamg9400285

06-05-2019

Once I enabled the tunnel service I was able to see data of users in community console but they were nor present under /home/users.

Is there any way we can reverse replicate the node structure as well.

e.g. if a user is created on publish, it should be reverse replicate to author.

Highlighted

Avatar

Avatar

jbrar

Employee

Avatar

jbrar

Employee

jbrar
Employee

07-05-2019

Can you share the usecase where you require users on author as well? As per the design, you should use tunnel service to check the users but all operations should be performed on publish side.