Change the User Business Unit

When I tried to change the existing user business unit I am getting below error

 

[2010-07-27 11:19:25.6] Process: w3wp |Organization:8dc8605c-39d6-46ff-bea3-2defb9febe8a |Thread:    3 |Category: Platform |User: 1c19f749-806a-4e62-8f84-363e0885a37f |Level: Error | MessageProcessor.Execute
>MessageProcessor fail to process message ‘SetBusiness’ for ‘systemuser’.
[2010-07-27 11:19:25.6] Process: w3wp |Organization:8dc8605c-39d6-46ff-bea3-2defb9febe8a |Thread:    3 |Category: Exception |User: 1c19f749-806a-4e62-8f84-363e0885a37f |Level: Error | CrmException..ctor
 at CrmException..ctor(String message, Exception innerException, Int32 errorCode)
 at SoapExtensionExceptionHandlerBase.GetCrmException(Exception exception)
 at InProcessCrmService.Execute(Object request)
 at PlatformCommand.ExecuteInternal()
 at SetBusinessSystemUserCommand.Execute()
 at ChangeOrgDialogPage.ConfigureForm()
 at AppUIPage.OnPreRender(EventArgs e)
 at Control.PreRenderRecursiveInternal()
 at Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
 at Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
 at Page.ProcessRequest()
 at Page.ProcessRequest(HttpContext context)
 at ceridian__grid_cmds_dlg_changeorg_aspx.ProcessRequest(HttpContext context)
 at CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
 at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
 at ApplicationStepManager.ResumeSteps(Exception error)
 at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
 at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
 at HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
 at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)
>Crm Exception: Message: , ErrorCode: -2147204784, InnerException: System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
The statement has been terminated.
   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.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.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command)
   at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate)
   at Microsoft.Crm.BusinessEntities.BusinessProcessObject.ExecuteNonQuery(IDbCommand command, ISqlExecutionContext context)
   at Microsoft.Crm.ObjectModel.SystemUserServiceInternal`1.UpdateBusinessIdForEntity(EntityMetadata entity, Guid userId, Guid businessId, ExecutionContext context)
   at Microsoft.Crm.ObjectModel.SystemUserServiceInternal`1.SetBusinessIdForOwnedObjects(Guid userId, Guid businessId, ExecutionContext context)
   at Microsoft.Crm.ObjectModel.SystemUserServiceInternal`1.SetBusiness(Guid userId, Guid businessId, SecurityPrincipal reassignPrincipal, ExecutionContext context)
[2010-07-27 11:19:25.6] Process: w3wp |Organization:8dc8605c-39d6-46ff-bea3-2defb9febe8a |Thread:    3 |Category: Application |User: 00000000-0000-0000-0000-000000000000 |Level: Error | ErrorInformation.LogError
>MSCRM Error Report:
——————————————————————————————————–
Error: Exception of type ‘System.Web.HttpUnhandledException’ was thrown.

Error Message: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Error Details: Exception of type ‘System.Web.HttpUnhandledException’ was thrown.

Source File: Not available

Line Number: Not available

Request URL:
http://localhost:5555/Ceridian/_grid/cmds/dlg_changeorg.aspx?iObjType=8&iTotal=1&iIndex=0&ownerId={F12D119E-0195-DF11-B110-0050569111A6}&ownerType=10&iId={6681E98B-2285-DF11-BE2C-0050569111A6
}

Stack Trace Info: [SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
The statement has been terminated.]
   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.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.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command)
   at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate)
   at Microsoft.Crm.BusinessEntities.BusinessProcessObject.ExecuteNonQuery(IDbCommand command, ISqlExecutionContext context)
   at Microsoft.Crm.ObjectModel.SystemUserServiceInternal`1.UpdateBusinessIdForEntity(EntityMetadata entity, Guid userId, Guid businessId, ExecutionContext context)
   at Microsoft.Crm.ObjectModel.SystemUserServiceInternal`1.SetBusinessIdForOwnedObjects(Guid userId, Guid businessId, ExecutionContext context)
   at Microsoft.Crm.ObjectModel.SystemUserServiceInternal`1.SetBusiness(Guid userId, Guid businessId, SecurityPrincipal reassignPrincipal, ExecutionContext context)

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   at Microsoft.Crm.Application.Utility.Util.RaiseXMLError(Exception exception)
   at Microsoft.Crm.Dialogs.ChangeOrgDialogPage.ConfigureForm()
   at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e)
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

[HttpUnhandledException: Exception of type ‘System.Web.HttpUnhandledException’ was thrown.]
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP.ceridian__grid_cmds_dlg_changeorg_aspx.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

 

Try extending your timeout

I dont think its with Timeout issue. I tried increasing the time as shown in the blog, but it didnt work.

Your stack trace does mention a timeout so maybe it is jus failing during the step to move all of the records owned by the user to another user.You could try assigning all of the user’s owned records to another user first and then try changing the user’s business unit.