Removing Inherited Permissions Causes Time Out In Logs

  • 1 April 2019
  • 2 replies
  • 46 views

Badge +1

We have a workflow that runs on new items that initially removes all inherited permissions from the list and then grants extra permissions to the users that need it. We have had issues with this for a while and after some investigation and checking the logs we get this at the time of the workflow erroring. 

 

System.Workflow.Runtime.Hosting.PersistenceException: The transaction has aborted. ---> System.Transactions.TransactionAbortedException: The transaction has aborted. ---> System.TimeoutException: Transaction Timeout -
-- End of inner exception stack trace --- 
at System.Transactions.TransactionStateAborted.CreateAbortingClone(InternalTransaction tx) 
at System.Transactions.DependentTransaction..ctor(IsolationLevel isoLevel, InternalTransaction internalTransaction, Boolean blocking) 
at System.Transactions.Transaction.DependentClone(DependentCloneOption cloneOption) 
at System.Transactions.TransactionScope.SetCurrent(Transaction newCurrent) 
at System.Transactions.TransactionScope.PushScope() 
at System.Transactions.TransactionScope..ctor(TransactionScopeOption scopeOption) 
at Microsoft.SharePoint.Workflow.SPWinOePersistenceService.Commit(Transaction transaction, ICollection items) 
at System.Workflow.Runtime.WorkBatch.PendingWorkCollection.Commit(Transaction transaction) 
at System.Workflow.Runtime.WorkBatch.Commit(Transaction transaction) 
at System.Workflow.Runtime.Hosting.WorkflowCommitWorkBatchService.CommitWorkBatch(CommitWorkBatchCallback commitWorkBatchCallback) 
at System.Workflow.Runtime.Hosting.DefaultWorkflowCommitWorkBatchService.CommitWorkBatch(CommitWorkBatchCallback commitWorkBatchCallback) 
at System.Workflow.Runtime.WorkflowExecutor.CommitTransaction(Activity activityContext) 
at System.Workflow.Runtime.WorkflowExecutor.Persist(Activity dynamicActivity, Boolean unlock, Boolean needsCompensation) -
-- End of inner exception stack trace --- 
at System.Workflow.Runtime.WorkflowExecutor.Persist(Activity dynamicActivity, Boolean unlock, Boolean needsCompensation) 
at System.Workflow.Runtime.WorkflowExecutor.System.Workflow.ComponentModel.IWorkflowCoreRuntime.PersistInstanceState(Activity activity) 
at System.Workflow.ComponentModel.Activity.MarkClosed() 
at System.Workflow.ComponentModel.ActivityExecutionContext.CloseActivity() 
at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime) 
at System.Workflow.Runtime.Scheduler.Run()

It seems that the removal of the inherited permissions is taking too long and causing it to time out. Is there someway to remove inherited permissions in a simpler way or would i need to increase the time out time? 

 

I have tried seperating the workflow down into individual steps to remove / grant permissions: 

 

1286iEBEF613A5F9F2441.png

Any help would be great. 

 

Thanks


2 replies

Badge +10

I think you should use one contorl to remove and set privileges. I don't think it is a good idea to use save pending changes. Also if you remove the permission on the item and commit pending changes, no one will have permission to do anything on the item.

 

What hapens if you use single control to set privilege?

Or Try running the set privilege contorl by workflow owner by ticking the option in Common tab of the control

 

Badge +1

The previous workflow had one "Set Permissions" action that removed and added permissions. I had broken it down to see if it would help with the time out issue. When the workflow first runs, it times out but when looking at the permissions on that item it seems that all permissions are actually removed. Then i terminate the errored workflow and re run it, it then works fine (Probably because the removing of inheritance has already been completed). 

 

Attached Image of original workflow. 

Reply