Workflow repeats hundreds of times on asset uploading | AEM

To resolve this issue, you can either add the delete permission on asset folders for the user, or you can change the properties of
/libs/dam/gui/content/assets/jcr:content/body/assetscontent/header/items/default/items/fileupload.

Description description

Issue
Uploading mp4 files in Assets console by drag & drop, the workflows for each mp4 files repeated hundreds of times for hours.
For example, the workflows of DAM Update Asset for one mp4 repeated 890 times. Every 5 seconds after a workflow instance ended, and a new workflow instance began.

This issue generated error messages similar to below:

15.01.2018 10:40:06.628 *ERROR* [ XX.XXX.XX.XX [ 1586753090032]  POST /content/dam/path/to/file.createasset.html HTTP/1.1]  com.day.XX.XXX.core.impl.servlet.CreateAssetServlet Error while creating new asset: Unable to commit changes to session.

org.apache.sling.api.resource.PersistenceException: Unable to commit changes to session.

...

Caused by: javax.jcr.AccessDeniedException: OakAccess0000: Access denied

...

Caused by: org.apache.jackrabbit.oak.api.CommitFailedException: OakAccess0000: Access denied

at org.apache.jackrabbit.oak.security.authorization.permission.PermissionValidator.checkPermissions(PermissionValidator.java:212)

at org.apache.jackrabbit.oak.security.authorization.permission.PermissionValidator.childNodeDeleted(PermissionValidator.java:168)

Another reported symptom is a red blinking onscreen during the asset upload.

Environment

Adobe Experience Manager 6.1 SP1 (AEM 6.1 SP1)

Cause

When trying to upload the asset, the user doesn’t have the delete permission on the folder.

As a result, when the user uploads a large file (5 MB+), AEM uploads the file dividing it into multiple chunks which are stored under asset node.

Once all chunks are uploaded, AEM consolidates the chunks as the original file, starts DAM Update Asset workflow, and clears the chunks.

But when the user doesn’t have the delete permission, clearing the chunks fails and as a consequence, file upload restarts again.


Specified Messages

ERROR * POST /content/XXX/*.createasset.html HTTP/1.1]  com.XXX.XX.XXX.core.impl.servlet.CreateAssetServlet Error while creating new asset: Unable to commit changes to session.

org.apache.sling.api.resource.PersistenceException: Unable to commit changes to session.

Caused by: javax.jcr.AccessDeniedException: OakAccess0000: Access denied

Resolution resolution

Resolutions
There are two ways to resolve this issue:

Resolution Method 1
Add the delete permission on asset folders for the user.

Resolution Method 2
Change the properties of:
/libs/dam/gui/content/assets/jcr:content/body/assetscontent/header/items/default/items/fileupload

To increase the minimum bytes of chunk upload, increase chunkUploadMinFileSize.
To disable chunk upload, set false to chunkUploadSupported.

recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f