Workflow repeats hundreds of times on asset uploading | AEM

Description

Issue
A customer uploaded four mp4 files in Assets console by drag & drop.
Then the workflows for each mp4 files repeated hundreds of times almost two hours.
For example, the workflows of DAM Update Asset for one mp4 repeated 890 times. Every 5 seconds after a workflow instance ended, new workflow instance began.
There are a flood of error messages like 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)

The customer also reported that they saw something blinking in red during the asset uploading.
Environment
AEM 6.1 SP1
Cause
The user who was trying to upload the asset does not have delete permission on the folder.

Due to that, when the user uploads a large file (5MB+), 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 delete permission, clearing the chunks fails and as a result, file upload restarts.

Specified Message
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
Add delete permission on asset folders for the user.

Or, 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.

On this page