none
(MIM 2016) UnwillingToPerformException when adding multiple users at once RRS feed

  • Question

  • Hi,

    when the sync service is exporting multiple new users into the portal all at once (around 20 or 30 at a time) and the workflows start to fill attrbiutes like login name, there are some users (around 20%) who dont get some of their attributes populated.

    These two error messages are the ones that appear almost at the same rate:

    Microsoft.ResourceManagement.WebServices.Exceptions.UnwillingToPerformException: Other ---> 
    Procedure: ReRaiseException. Line number: 37. Message: A Sql failure occurred during Request processing., State 1, 
    Procedure ReRaiseException, Line 37, Message: Reraised Error 50000, Level 16, State 1, 
    Procedure ReRaiseException, Line 37, Message: Reraised Error 50000, Level 16, State 1, 
    Procedure UpdateResource, Line 61, Message: RequestSqlOperationException: Not able to acquire a lock for UpdateResource because it is locked by another process.. 
    --- End of inner exception stack trace --- 
    at Microsoft.ResourceManagement.Utilities.ExceptionManager.ThrowException(Exception exception) 
    at Microsoft.ResourceManagement.Data.Exception.DataAccessExceptionManager.ThrowException(SqlException innerException, TransactionAndConnectionScope scope) 
    at Microsoft.ResourceManagement.Data.DataAccess.ProcessRequest(RequestType request) 
    at Microsoft.ResourceManagement.ActionProcessor.ActionDispatcher.ProcessInputRequest(RequestType request) 
    at Microsoft.ResourceManagement.WebServices.RequestDispatcher.ExecuteAction(RequestType request) 
    at Microsoft.ResourceManagement.WebServices.RequestDispatcher.ExecuteAction[ResponseBodyType](RequestType request) 
    at Microsoft.ResourceManagement.WebServices.RequestDispatcher.DispatchRequest[ResponseBodyType](RequestType request, Guid requestIdentifier, Object redispatchSingleInstanceKey, Boolean isRedispatch) 
    at Microsoft.ResourceManagement.WebServices.RequestDispatcher.DispatchRequest[ResponseBodyType](RequestType request) 
    at Microsoft.ResourceManagement.Workflow.Hosting.RequestWorkItemProcessor.DispatchRequest[TResponseType](RequestType request, Boolean applyAuthorizationPolicy) 
    at Microsoft.ResourceManagement.Workflow.Hosting.RequestWorkItemProcessor.ProcessPutWorkItem(UpdateRequestWorkItem updateWorkItem) 
    at Microsoft.ResourceManagement.Workflow.Hosting.RequestWorkItemProcessor.ProcessWorkItem(WorkItem workItem)
    Microsoft.ResourceManagement.WebServices.Exceptions.UnwillingToPerformException: Other ---> 
    System.Data.SqlClient.SqlException: Reraised Error 50000, Level 13, State 1, 
    Procedure ReRaiseException, Line 37, Message: Reraised Error 50000, Level 13, State 1, 
    Procedure ReRaiseException, Line 37, Message: Reraised Error 1205, Level 13, State 52, 
    Procedure UpdateResource, Line 587, Message: Transaction (Process ID 154) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. 
    Rerun the transaction. Uncommittable transaction is detected at the end of the batch. The transaction is rolled back. 
    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) 
    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) 
    at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) 
    at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() 
    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) 
    at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) 
    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() 
    at Microsoft.ResourceManagement.Data.DataAccess.ProcessRequest(RequestType request) 
    --- End of inner exception stack trace --- 
    at Microsoft.ResourceManagement.Utilities.ExceptionManager.ThrowException(Exception exception) 
    at Microsoft.ResourceManagement.Data.Exception.DataAccessExceptionManager.ThrowException(SqlException innerException, TransactionAndConnectionScope scope) 
    at Microsoft.ResourceManagement.Data.DataAccess.ProcessRequest(RequestType request) 
    at Microsoft.ResourceManagement.ActionProcessor.ActionDispatcher.ProcessInputRequest(RequestType request) 
    at Microsoft.ResourceManagement.WebServices.RequestDispatcher.ExecuteAction(RequestType request) 
    at Microsoft.ResourceManagement.WebServices.RequestDispatcher.ExecuteAction[ResponseBodyType](RequestType request) 
    at Microsoft.ResourceManagement.WebServices.RequestDispatcher.DispatchRequest[ResponseBodyType](RequestType request, Guid requestIdentifier, Object redispatchSingleInstanceKey, Boolean isRedispatch) 
    at Microsoft.ResourceManagement.WebServices.RequestDispatcher.DispatchRequest[ResponseBodyType](RequestType request) 
    at Microsoft.ResourceManagement.Workflow.Hosting.RequestWorkItemProcessor.DispatchRequest[TResponseType](RequestType request, Boolean applyAuthorizationPolicy) 
    at Microsoft.ResourceManagement.Workflow.Hosting.RequestWorkItemProcessor.ProcessPutWorkItem(UpdateRequestWorkItem updateWorkItem) 
    at Microsoft.ResourceManagement.Workflow.Hosting.RequestWorkItemProcessor.ProcessWorkItem(WorkItem workItem)
    MIM is already patched to Version 4.5.412.0 because i saw that there was a similar bug fixed in a recent update.

    Any advice would be appreciated.


    • Edited by ChrisDoe Tuesday, December 3, 2019 3:21 PM
    Tuesday, December 3, 2019 3:21 PM

Answers

  • I would need to see exactly what you are doing, but one easy way is to add a delay step on your workflow as acrivity one, using MIMWal Delay. Simply the workow will not trigger right away.

    Nosh Mernacaj, Identity Management Specialist

    • Proposed as answer by Nosh Mernacaj Thursday, December 5, 2019 12:31 PM
    • Marked as answer by ChrisDoe Thursday, December 5, 2019 12:44 PM
    Thursday, December 5, 2019 12:31 PM

All replies

  • What are the attributes you are setting? Are there any workflows that trigger on user creation?

    Nosh Mernacaj, Identity Management Specialist

    Thursday, December 5, 2019 12:47 AM
  • Yes, there is a workflow that is setting the Login Name of the affected users by combining their domain and account name. it is this attribute thats being left blank after the error occurs.
    Thursday, December 5, 2019 7:16 AM
  • That workflow is causing sql deadlock. User is not completely created with all the attributes when the workflow triggers. You need to change the time when the workflow kicks.  Export has to complete before the workflow starts. You cant have two updates ate the same tine in one object. If your workflow is set to trigger on a transition in set, I am assuming "all users", then as soon as user is created the condition is met. Both MIM synch and your workflow are trying to write to same user.


    Nosh Mernacaj, Identity Management Specialist


    Thursday, December 5, 2019 12:03 PM
  • Yes thats about how it goes, so how would i delay that? I need to set attributes according to certain criteria on the user.
    Thursday, December 5, 2019 12:07 PM
  • I would need to see exactly what you are doing, but one easy way is to add a delay step on your workflow as acrivity one, using MIMWal Delay. Simply the workow will not trigger right away.

    Nosh Mernacaj, Identity Management Specialist

    • Proposed as answer by Nosh Mernacaj Thursday, December 5, 2019 12:31 PM
    • Marked as answer by ChrisDoe Thursday, December 5, 2019 12:44 PM
    Thursday, December 5, 2019 12:31 PM
  • Thanks, yes i think thats the only solution right now, i was hoping that MIM would do this internally but i guess not
    Thursday, December 5, 2019 12:52 PM
  • To give a little more context.

    1- Attributes set as Initial Flow (Or if you use code, provisioning code) - are the ones that get set during creation and set during creation task. 

    2- Attributes set as persistent flow - are updates to created object.

    3- Any workflow you create, is unaware of anything other then the set. When user is created on step 1, the condition is met and the workflow triggers.


    Nosh Mernacaj, Identity Management Specialist

    Thursday, December 5, 2019 1:01 PM