Workflow repeats hundreds of times on asset uploading | AEM

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 1515980405832 POST /content/dam/path/to/file.createasset.html HTTP/1.1 com.day.cq.dam.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 was a red blinking onscreen during the asset uploading.

Environment

AEM 6.1 SP1

Cause

The user who was trying to upload the asset does not 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 does not have the delete permission, clearing the chunks fails and as a consequence, file upload restarts again.


Specified Messages

ERROR * POST /content/dam/*.createasset.html HTTP/1.1 com.day.cq.dam.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