acs-aem-commons
acs-aem-commons copied to clipboard
Renovator fails to move asset folder if folder has a review task
Required Information
- [x] AEM Version, including Service Packs, Cumulative Fix Packs, etc: 6.5.12, 6.5.5 (probably other versions also)
- [x] ACS AEM Commons Version: 5.3.0
- [x] Reproducible on Latest? yes
Expected Behavior
Renovator MCP process should move folders as described in the documentation https://adobe-consulting-services.github.io/acs-aem-commons/features/mcp-tools/renovator/index.html
Actual Behavior
The process fails partway through the move (in the buildStructures step), leaving a partially completed move committed.
Steps to Reproduce
Starting from a vanilla instance of AEM at the above version, describe in explicit steps how to reproduce. Link to any supporting assets, e.g. content packages, below
- Start from a vanilla AEM 6.5.12 instance
- Go to Assets area and create a review task on a folder (e.g. /content/dam/we-retail/en/activities/hiking)
- Trigger the MCP renovator process to move the folder (do not select "Dry run")
- Observe the process fails with error. The stack trace refers to nodes not existing on the destination path.
- Observe the process has made some commits (e.g. target folders created), so the move is part way in progress
Example stack trace
29.04.2022 17:15:35.511 *ERROR* [pool-33-thread-3] com.adobe.acs.commons.fam.impl.ActionManagerImpl Error in action Renovator: Publish mode none: Build destination (0d1e996d-6df0-4f83-9fcc-b11cb0496777)
org.apache.sling.api.resource.PersistenceException: Unable to delete resource
at org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider.delete(JcrResourceProvider.java:500) [org.apache.sling.jcr.resource:3.0.18]
at org.apache.sling.resourceresolver.impl.providers.stateful.AuthenticatedResourceProvider.delete(AuthenticatedResourceProvider.java:193) [org.apache.sling.resourceresolver:1.7.10]
at org.apache.sling.resourceresolver.impl.helper.ResourceResolverControl.delete(ResourceResolverControl.java:413) [org.apache.sling.resourceresolver:1.7.10]
at org.apache.sling.resourceresolver.impl.helper.ResourceResolverControl.copy(ResourceResolverControl.java:606) [org.apache.sling.resourceresolver:1.7.10]
at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.copy(ResourceResolverImpl.java:1126) [org.apache.sling.resourceresolver:1.7.10]
at com.adobe.acs.commons.mcp.impl.processes.renovator.MovingFolder.lambda$move$0(MovingFolder.java:79) [com.adobe.acs.acs-aem-commons-bundle:5.3.0]
at com.adobe.acs.commons.fam.actions.Actions.lambda$retry$2(Actions.java:141) [com.adobe.acs.acs-aem-commons-bundle:5.3.0]
at com.adobe.acs.commons.fam.impl.ActionManagerImpl.withResolver(ActionManagerImpl.java:200) [com.adobe.acs.acs-aem-commons-bundle:5.3.0]
at com.adobe.acs.commons.fam.impl.ActionManagerImpl.runActionAndLogErrors(ActionManagerImpl.java:167) [com.adobe.acs.acs-aem-commons-bundle:5.3.0]
at com.adobe.acs.commons.fam.impl.ActionManagerImpl.lambda$deferredWithResolver$0(ActionManagerImpl.java:159) [com.adobe.acs.acs-aem-commons-bundle:5.3.0]
at com.adobe.acs.commons.fam.impl.TimedRunnable.run(TimedRunnable.java:91) [com.adobe.acs.acs-aem-commons-bundle:5.3.0]
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: javax.jcr.InvalidItemStateException: This item [/content/dam/we-retail/en/activities/hiking-moved/jcr:content/folderThumbnail] does not exist anymore
at org.apache.jackrabbit.oak.jcr.delegate.ItemDelegate.checkAlive(ItemDelegate.java:86) [org.apache.jackrabbit.oak-jcr:1.22.9]
at org.apache.jackrabbit.oak.jcr.session.ItemImpl$ItemWriteOperation.checkPreconditions(ItemImpl.java:96) [org.apache.jackrabbit.oak-jcr:1.22.9]
at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.prePerform(SessionDelegate.java:614) [org.apache.jackrabbit.oak-jcr:1.22.9]
at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.performVoid(SessionDelegate.java:270) [org.apache.jackrabbit.oak-jcr:1.22.9]
at org.apache.jackrabbit.oak.jcr.session.NodeImpl.remove(NodeImpl.java:235) [org.apache.jackrabbit.oak-jcr:1.22.9]
at org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider.delete(JcrResourceProvider.java:498) [org.apache.sling.jcr.resource:3.0.18]
... 15 common frames omitted
29.04.2022 17:15:35.511 *ERROR* [pool-33-thread-3] com.adobe.acs.commons.fam.impl.ActionManagerImpl Caught exception in task: Unable to delete resource
org.apache.sling.api.resource.PersistenceException: Unable to delete resource
at org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider.delete(JcrResourceProvider.java:500) [org.apache.sling.jcr.resource:3.0.18]
at org.apache.sling.resourceresolver.impl.providers.stateful.AuthenticatedResourceProvider.delete(AuthenticatedResourceProvider.java:193) [org.apache.sling.resourceresolver:1.7.10]
at org.apache.sling.resourceresolver.impl.helper.ResourceResolverControl.delete(ResourceResolverControl.java:413) [org.apache.sling.resourceresolver:1.7.10]
at org.apache.sling.resourceresolver.impl.helper.ResourceResolverControl.copy(ResourceResolverControl.java:606) [org.apache.sling.resourceresolver:1.7.10]
at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.copy(ResourceResolverImpl.java:1126) [org.apache.sling.resourceresolver:1.7.10]
at com.adobe.acs.commons.mcp.impl.processes.renovator.MovingFolder.lambda$move$0(MovingFolder.java:79) [com.adobe.acs.acs-aem-commons-bundle:5.3.0]
at com.adobe.acs.commons.fam.actions.Actions.lambda$retry$2(Actions.java:141) [com.adobe.acs.acs-aem-commons-bundle:5.3.0]
at com.adobe.acs.commons.fam.impl.ActionManagerImpl.withResolver(ActionManagerImpl.java:200) [com.adobe.acs.acs-aem-commons-bundle:5.3.0]
at com.adobe.acs.commons.fam.impl.ActionManagerImpl.runActionAndLogErrors(ActionManagerImpl.java:167) [com.adobe.acs.acs-aem-commons-bundle:5.3.0]
at com.adobe.acs.commons.fam.impl.ActionManagerImpl.lambda$deferredWithResolver$0(ActionManagerImpl.java:159) [com.adobe.acs.acs-aem-commons-bundle:5.3.0]
at com.adobe.acs.commons.fam.impl.TimedRunnable.run(TimedRunnable.java:91) [com.adobe.acs.acs-aem-commons-bundle:5.3.0]
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: javax.jcr.InvalidItemStateException: This item [/content/dam/we-retail/en/activities/hiking-moved/jcr:content/folderThumbnail] does not exist anymore
at org.apache.jackrabbit.oak.jcr.delegate.ItemDelegate.checkAlive(ItemDelegate.java:86) [org.apache.jackrabbit.oak-jcr:1.22.9]
at org.apache.jackrabbit.oak.jcr.session.ItemImpl$ItemWriteOperation.checkPreconditions(ItemImpl.java:96) [org.apache.jackrabbit.oak-jcr:1.22.9]
at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.prePerform(SessionDelegate.java:614) [org.apache.jackrabbit.oak-jcr:1.22.9]
at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.performVoid(SessionDelegate.java:270) [org.apache.jackrabbit.oak-jcr:1.22.9]
at org.apache.jackrabbit.oak.jcr.session.NodeImpl.remove(NodeImpl.java:235) [org.apache.jackrabbit.oak-jcr:1.22.9]
at org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider.delete(JcrResourceProvider.java:498) [org.apache.sling.jcr.resource:3.0.18]
... 15 common frames omitted
Links
NA
AEM 6.5.12 (Vanilla) ACS Commons: 5.3.0
@josephrignanese - i was able to move a folder with a review task attached to it without issues.
I have no exceptions during this. Are you sure your repository is in a stable state? Do you get the same if you OOTB move the folder?
I did notice that Renovator does NOT adjust the review path's contentPath property value (so after the move it still points to the old non-existent path) - however, I checked OOTB Moving of a folder with a review task attached and its the same behavior as renovator (the task is now broken) so I imagine that this is not a supported use-case in AEM?
If we were to enhance Renovator, i think we'd have to add a findReferences() to MovingFolder, and part of that would be search for all review tasks w/ an affected contentPath.
[1] https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/master/bundle/src/main/java/com/adobe/acs/commons/mcp/impl/processes/renovator/MovingFolder.java
Hi @davidjgonzalez - did you do a dry run or actual move?
The dry run goes successfully, and when I get an error I get a similar report to the one you have but also get an error report.
MCP Screenshot:
Process Modal Screenshot:
Report Screenshot:
Error report screenshot:
Hi @davidjgonzalez,
I'm uploading some more info, maybe it will help to reproduce.
Content package of folder with review task: src-asset-folder-with-review-task-1.0.zip
MCP input values:
Source: /content/dam/we-retail/en/experiences/wester-australia-by-camper-van1 Destination: /content/dam/we-retail/en/experiences/wester-australia-by-camper-van1-moved Max References: -1 (Default) Publish: None Create versions: Yes Update status: Yes Extensive ACL checks: No Dry run: No Audit Trails: No Detailed Report: Yes
Screenshot of MCP process:
Content package from failed MCP process instance: renovator-failed-mcp-instance-1.0.zip
AEM error.log during MCP run: renovator-failed-aem-error.log.zip
i was trying to move the asset but i am facing the stuck issue here, can anyone help me
A workaround: go to workflow instance. and terminate running workflows. it did the job for me