Error removing the IUser in EpiServer - SqlException: Execution Timeout

1

I have used,

CommunitySystem.CurrentContext.DefaultSecurity.RemoveUser(IUser user);

To remove user.

However, this was working fine. But suddenly it has given an error. And it keeps happening forever. The exception throws from the RemoveUser(IUser user).

The exception details are here as below,

System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out
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, Boolean isInternal, Boolean forDescribeParameterEncryption)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
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 EPiServer.Community.Forum.Data.ForumFactory.<>c__DisplayClass33_0.<UserRemovedCleanUp>b__0()
at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.<>c__DisplayClass32_0.<ExecuteTransaction>b__0()
at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.<>c__DisplayClass33_0`1.<ExecuteTransaction>b__0()
at EPiServer.Community.Forum.ForumModule.DefaultSecurity_RemovedUser(ISecurityHandler sender, IRemoveUserEventArgs args)
at EPiServer.Common.Security.RemoveUserEventHandler.Invoke(ISecurityHandler sender, IRemoveUserEventArgs args)
at EPiServer.Common.Security.SecurityHandler.OnRemoveUser(IRemoveUserEventArgs args)
at EPiServer.Common.Security.Data.SecurityFactory.<>c__DisplayClass57_0.<RemoveUser>b__0()
at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.<>c__DisplayClass32_0.<ExecuteTransaction>b__0()
at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor.<>c__DisplayClass33_0`1.<ExecuteTransaction>b__0()
at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method)
at EPiServer.Common.Security.SecurityHandler.RemoveUser(IUser user)

As per above error, it seems like it is happening due to a DB issue. But what DB? How Can I diagnose? What could cause this? Any help appreciated. Thank you.

Additional info:

EPiServer.CommonFramework version=9.0.1
EPiServer.CMS.Core version=11.9.2
EPiServer.Community version=9.0.0

Update: I have posted the same question on Episerver Forums and got no answer

episerver
asked on Stack Overflow Jan 9, 2019 by Senura Dissanayake • edited Feb 5, 2019 by Senura Dissanayake

1 Answer

0

Increasing the ‘episerver.datastore’ timeout value to 5mins has worked.

<episerver.dataStore>
  <dataSettings 
  connectionStringName="EPiServerDB"
  retries="5"
  retryDelay="0:0:0.1"
  databaseQueryTimeout="0:05:00" />
</episerver.dataStore>

Note: The dataSettings was not in the code. Added it explicitly.

answered on Stack Overflow May 15, 2019 by Senura Dissanayake

User contributions licensed under CC BY-SA 3.0