locked
Designer Workflow Error RRS feed

  • Question

  • Hi,

    I create a designer workflow to set the list item permission as below:

    This workflow was triggered when item created. Moreover, I use the JavaScript to create the list item by async.

    Some time I will encounter below error:

     

    Error Details – SharePoint log attached

    06/29/2016 15:08:09.34  w3wp.exe (0x465C)        0x6434  SharePoint Foundation Legacy Workflow Infrastructure                88xr                Unexpected       WinWF Internal Error, terminating workflow Id# 38c56042-1e20-4cf3-a1b7-9e540d92a72c                93d28a9d-f591-f059-7bff-80e1c1c76043

    06/29/2016 15:08:09.35  w3wp.exe (0x465C)        0x6434  SharePoint Foundation Legacy Workflow Infrastructure                98d4      Unexpected       System.Workflow.Runtime.Hosting.PersistenceException ---> Microsoft.SharePoint.SPException ---> System.Runtime.InteropServices.COMException: <nativehr>0x80131904</nativehr><nativestack></nativestack>     at Microsoft.SharePoint.Library.SPRequestInternalClass.UpdateMembers(String bstrUrl, UInt32 dwObjectType, String bstrObjId, Guid& pguidScopeId, Int32 lGroupID, Int32 lGroupOwnerId, Object& pvarArrayAdd, Object& pvarArrayAddIds, Object& pvarArrayLoginsRemove, Object& pvarArrayIdsRemove, Boolean bRemoveFromCurrentScopeOnly, Boolean bSendEmail)     at Microsoft.SharePoint.Library.SPRequest.UpdateMembers(String bstrUrl, UInt32 dwObjectType, String bstrObjId, Guid& pguidScopeId, Int32 lGroupID, Int32 lGroupOwnerId, Object& pvarArrayAdd, Object& pvarArrayAddIds, Object& pvarArrayLoginsRemove, Object& pvarArrayIdsRemove, Boolean bRemoveFromCurrentScopeOnly, Boolean bSendEmail)     --- End of inner exception stack trace ---     at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)     at Microsoft.SharePoint.Library.SPRequest.UpdateMembers(String bstrUrl, UInt32 dwObjectType, String bstrObjId, Guid& pguidScopeId, Int32 lGroupID, Int32 lGroupOwnerId, Object& pvarArrayAdd, Object& pvarArrayAddIds, Object& pvarArrayLoginsRemove, Object& pvarArrayIdsRemove, Boolean bRemoveFromCurrentScopeOnly, Boolean bSendEmail)     at Microsoft.SharePoint.SPUserCollection.UpdateMembers(Object objUpdateInfo, Object objAddIds, Object objRemoveLogins, Object objRemoveIds, Boolean fSendEmail)     at Microsoft.SharePoint.SPUserCollection.AddCollection(SPUserInfo[] addUsersInfo, IEnumerable`1 addUsers)     at Microsoft.SharePoint.Workflow.SPWinOEWSSService.WorkflowUserGroupHelper.CommitAddUserInternal(SPWeb web, IEnumerable`1 userIds)     at Microsoft.SharePoint.Workflow.SPWinOEWSSService.WorkflowUserGroupHelper.<>c__DisplayClass2.<CommitAddUser>b__0()     at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass5.<RunWithElevatedPrivileges>b__3()     at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)     at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)     at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)     at Microsoft.SharePoint.Workflow.SPWinOEWSSService.ApplyUncommittedAddedPermissions(SPListItem item, HybridDictionary addedPermissions, Boolean& hasInvalidUser, Boolean& hasInvalidPermission)     at Microsoft.SharePoint.Workflow.SPWinOEWSSService.ApplyUncommittedPermission(SPListItem item, HybridDictionary addedPermissions, HybridDictionary removedPermissions)     at Microsoft.SharePoint.Workflow.SPWinOEWSSService.ApplyListItemPermissionAsOwnerInternal(SPListItem ownerItem, PermissionRecord permissionRecord, Boolean isNewItem, SPUser owner, SPWeb ownerWeb)     at Microsoft.SharePoint.Workflow.SPWinOEWSSService.ApplyListItemPermissionAsOwner(SPListItem item, PermissionRecord permissionRecord, Boolean isNewItem)     at Microsoft.SharePoint.Workflow.SPWinOEWSSService.CommitUpdatePermission(Transaction txn, Object[] transData)     at Microsoft.SharePoint.Workflow.SPPendingWorkBatch.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.Activity.MarkCompleted()     at System.Workflow.ComponentModel.ActivityExecutionContext.CloseActivity()     at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)     at System.Workflow.Runtime.Scheduler.Run()       93d28a9d-f591-f059-7bff-80e1c1c76043

    System.Workflow.Runtime.Hosting.PersistenceException ---> Microsoft.SharePoint.SPException ---> System.Runtime.InteropServices.COMException: <nativehr>0x80131904</nativehr><nativestack></nativestack>   

     at Microsoft.SharePoint.Library.SPRequestInternalClass.UpdateMembers(String bstrUrl, UInt32 dwObjectType, String bstrObjId, Guid& pguidScopeId, Int32 lGroupID, Int32 lGroupOwnerId, Object& pvarArrayAdd, Object& pvarArrayAddIds, Object& pvarArrayLoginsRemove, Object& pvarArrayIdsRemove, Boolean bRemoveFromCurrentScopeOnly, Boolean bSendEmail)   

     at Microsoft.SharePoint.Library.SPRequest.UpdateMembers(String bstrUrl, UInt32 dwObjectType, String bstrObjId, Guid& pguidScopeId, Int32 lGroupID, Int32 lGroupOwnerId, Object& pvarArrayAdd, Object& pvarArrayAddIds, Object& pvarArrayLoginsRemove, Object& pvarArrayIdsRemove, Boolean bRemoveFromCurrentScopeOnly, Boolean bSendEmail)     -

    -- End of inner exception stack trace ---   

     at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)   

     at Microsoft.SharePoint.Library.SPRequest.UpdateMembers(String bstrUrl, UInt32 dwObjectType, String bstrObjId, Guid& pguidScopeId, Int32 lGroupID, Int32 lGroupOwnerId, Object& pvarArrayAdd, Object& pvarArrayAddIds, Object& pvarArrayLoginsRemove, Object& pvarArrayIdsRemove, Boolean bRemoveFromCurrentScopeOnly, Boolean bSendEmail)   

     at Microsoft.SharePoint.SPUserCollection.UpdateMembers(Object objUpdateInfo, Object objAddIds, Object objRemoveLogins, Object objRemoveIds, Boolean fSendEmail)   

     at Microsoft.SharePoint.SPUserCollection.AddCollection(SPUserInfo[] addUsersInfo, IEnumerable`1 addUsers)   

     at Microsoft.SharePoint.Workflow.SPWinOEWSSService.WorkflowUserGroupHelper.CommitAddUserInternal(SPWeb web, IEnumerable`1 userIds)   

     at Microsoft.SharePoint.Workflow.SPWinOEWSSService.WorkflowUserGroupHelper.<>c__DisplayClass2.<CommitAddUser>b__0()   

     at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass5.<RunWithElevatedPrivileges>b__3()   

     at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)   

     at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param)   

     at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)   

     at Microsoft.SharePoint.Workflow.SPWinOEWSSService.ApplyUncommittedAddedPermissions(SPListItem item, HybridDictionary addedPermissions, Boolean& hasInvalidUser, Boolean& hasInvalidPermission)   

     at Microsoft.SharePoint.Workflow.SPWinOEWSSService.ApplyUncommittedPermission(SPListItem item, HybridDictionary addedPermissions, HybridDictionary removedPermissions)   

     at Microsoft.SharePoint.Workflow.SPWinOEWSSService.ApplyListItemPermissionAsOwnerInternal(SPListItem ownerItem, PermissionRecord permissionRecord, Boolean isNewItem, SPUser owner, SPWeb ownerWeb)   

     at Microsoft.SharePoint.Workflow.SPWinOEWSSService.ApplyListItemPermissionAsOwner(SPListItem item, PermissionRecord permissionRecord, Boolean isNewItem)   

     at Microsoft.SharePoint.Workflow.SPWinOEWSSService.CommitUpdatePermission(Transaction txn, Object[] transData)   

     at Microsoft.SharePoint.Workflow.SPPendingWorkBatch.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.Activity.MarkCompleted()   

     at System.Workflow.ComponentModel.ActivityExecutionContext.CloseActivity()   

     at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)   

     at System.Workflow.Runtime.Scheduler.Run()

    System.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.GroupMembership' with unique index 'GroupMembership_GroupId'. The duplicate key value is (d4cc0269-8dc6-49a5-ae90-34ef408e532e, 191, 14).  The statement has been terminated.   

     at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)   

     at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)   

     at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)   

     at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()   

     at System.Data.SqlClient.SqlDataReader.get_MetaData()   

     at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)   

     at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)   

     at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)    

     at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)   

     at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)   

     at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)   

     at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock)   

     at Microsoft.SharePoint.SPSqlClient.ExecuteQueryInternal(Boolean retryfordeadlock)   

     at Microsoft.SharePoint.SPSqlClient.ExecuteQuery(Boolean retryfordeadlock)  ClientConnectionId:f359409c-4cec-4dc2-8d11-afae1a2768e4

    SqlError: 'Cannot insert duplicate key row in object 'dbo.GroupMembership' with unique index 'GroupMembership_GroupId'. The duplicate key value is (d4cc0269-8dc6-49a5-ae90-34ef408e532e, 191, 14).'    Source: '.Net SqlClient Data Provider' Number: 2601 State: 1 Class: 14 Procedure: 'proc_SecAddUserToSiteGroup' LineNumber: 42 Server: 'Balcarce.vtc.hk'

    System.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.GroupMembership' with unique index 'GroupMembership_GroupId'. The duplicate key value is (d4cc0269-8dc6-49a5-ae90-34ef408e532e, 191, 14).  The statement has been terminated.   

     at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)   

     at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)   

     at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)   

     at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()   

     at System.Data.SqlClient.SqlDataReader.get_MetaData()   

     at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)   

     at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)   

     at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)   

     at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)   

     at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)   

     at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)   

     at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock)  ClientConnectionId:f359409c-4cec-4dc2-8d11-afae1a2768e4

    System.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.Groups' with unique index 'Groups_Title'. The duplicate key value is (d4cc0269-8dc6-49a5-ae90-34ef408e532e, Council Meeting Workflow Users).  The statement has been terminated.   

     at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)   

     at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)   

     at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)   

     at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()   

     at System.Data.SqlClient.SqlDataReader.get_MetaData()   

     at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)   

     at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)   

     at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)   

     at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)   

     at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)   

     at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)   

     at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock)  ClientConnectionId:b04557fa-ed77-4ad1-8c83-cd2654730459

    Any idea in this error? 

    Best Regards

    Tuesday, July 5, 2016 6:37 AM

Answers

  • Hi,

    Your workflow step seems to be mess. Why don't you create the custom permission level and assign to the specific item and also update the Item. You don't want to remove the permission that were assigned on the item by default.

    You can just add permission (custom permission) to item and update it.


    Murugesa Pandian | MCPD | MCTS | SharePoint 2010 |

    Tuesday, July 5, 2016 8:22 AM
  • Hi Kit,

    Based on the error message, it seems the duplicated permission has been existed on the item member ship so the add permission to the item occured the error.

    I would suggest you can directly add the needed permission in one time as Murugesa's suggestion.

    Thanks

    Best Regards


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Wednesday, July 6, 2016 9:47 AM

All replies

  • Hi,

    Your workflow step seems to be mess. Why don't you create the custom permission level and assign to the specific item and also update the Item. You don't want to remove the permission that were assigned on the item by default.

    You can just add permission (custom permission) to item and update it.


    Murugesa Pandian | MCPD | MCTS | SharePoint 2010 |

    Tuesday, July 5, 2016 8:22 AM
  • Hi Kit,

    Based on the error message, it seems the duplicated permission has been existed on the item member ship so the add permission to the item occured the error.

    I would suggest you can directly add the needed permission in one time as Murugesa's suggestion.

    Thanks

    Best Regards


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Wednesday, July 6, 2016 9:47 AM