Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

DAM Update Asset Workflow failing

Avatar

Level 4

Hello All,

     We have a requirement, when we upload a pdf(say abc.pdf) to /content/dam/media/ folder, then some custom workflow we developed, creates a structure under /content/dam/media as follows.

/content/dam/media/<random-unique-name>/1.0/<random-unique-name.pdf>

But the moment we drop any asset to /content/dam/* folder, DAM update Asset Workflow triggers and start creating renditions for /content/dam/media/abc.pdf, but by the time it completes, asset is moved to /content/dam/media/<random-unique-name>/1.0/<random-unique-name.pdf> by custom workflow,  So DAM Update Asset workflow is throwing below exceptions.

30.08.2018 06:33:23.429 *ERROR* [JobHandler: /etc/workflow/instances/server0/2018-08-29_1/update_asset_118:/content/dam/media/abc.pdf/jcr:content/renditions/original] com.day.cq.dam.core.impl.RenditionMakerImpl Error while generating renditions for asset /content/dam/media/abc.pdf

javax.jcr.InvalidItemStateException: OakState0001: Unresolved conflicts in /content/dam/media

.....

Caused by: org.apache.jackrabbit.oak.api.CommitFailedException: OakState0001: Unresolved conflicts in /content/dam/test

30.08.2018 06:33:23.479 *ERROR* [JobHandler: /etc/workflow/instances/server0/2018-08-29_1/update_asset_118:/content/dam/media/abc.pdf/jcr:content/renditions/original] com.day.cq.dam.core.impl.AssetImpl saveAsset: error while saving asset [/content/dam/media/abc.pdf]:

javax.jcr.InvalidItemStateException: OakState0001: Unresolved conflicts in /content/dam/media

....

Caused by: org.apache.jackrabbit.oak.api.CommitFailedException: OakState0001: Unresolved conflicts in /content/dam/media

Though with above exceptions in log, in AEM 6.0, the workflow completes and creates renditions for moved asset /content/dam/media/<random-unique-name>/1.0/<random-unique-name.pdf>

Now we are migrating to AEM 6.3, and the DAM Update Asset workflow is not completing(in RUNNING state) because of above exceptions and no renditions are created for moved asset /content/dam/media/<random-unique-name>/1.0/<random-unique-name.pdf>

30.08.2018 06:33:25.505 *ERROR* [JobHandler: /etc/workflow/instances/server0/2018-08-29_1/update_asset_118:/content/dam/media/abc.pdf/jcr:content/renditions/original] com.day.cq.dam.commons.process.AbstractAssetWorkflowProcess getAssetFromPaylod: asset [/content/dam/media/abc.pdf/jcr:content/renditions/original] in payload of workflow [/etc/workflow/instances/server0/2018-08-29_1/update_asset_118] does not exist.

30.08.2018 06:33:25.505 *ERROR* [JobHandler: /etc/workflow/instances/server0/2018-08-29_1/update_asset_118:/content/dam/media/abc.pdf/jcr:content/renditions/original] com.day.cq.workflow.compatibility.CQWorkflowProcessRunner Process execution resulted in an error: com.day.cq.workflow.WorkflowException: execute: gatekeeping failed, asset [{/content/dam/media/abc.pdf/jcr:content/renditions/original}] in payload doesn't exist for workflow [{VolatileWorkItem_node1_etc_workflow_instances_server0_2018-08-29_1_update_asset_118}].

com.day.cq.workflow.WorkflowException: com.day.cq.workflow.WorkflowException: execute: gatekeeping failed, asset [{/content/dam/media/abc.pdf/jcr:content/renditions/original}] in payload doesn't exist for workflow [{VolatileWorkItem_node1_etc_workflow_instances_server0_2018-08-29_1_update_asset_118}].

                at com.day.cq.dam.core.process.GateKeeperProcess.execute(GateKeeperProcess.java:84)

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

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

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

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

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

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

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

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

                at java.lang.Thread.run(Thread.java:745)

Caused by: com.day.cq.workflow.WorkflowException: execute: gatekeeping failed, asset [{/content/dam/research/media/abc.pdf/jcr:content/renditions/original}] in payload doesn't exist for workflow [{VolatileWorkItem_node1_etc_workflow_instances_server0_2018-08-29_1_update_asset_118}].

                at com.day.cq.dam.core.process.GateKeeperProcess.execute(GateKeeperProcess.java:81)

                ... 10 common frames omitted

Is there anyway to continue and complete the workflow like in AEM 6.0, even if it fails for creating renditions on the /content/dam/media/abc.pdf ?

12 Replies