Try our conversational search powered by Generative AI!

Empty Trash - Timeout expired



Our Production website is fairly large website. Where Empty Trash functionality Never work, (Automatic Emptying of Trash Job sometime will delete 2/3 entries.)

The Exception we get on clicking Empty Trash is following 

[SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.]

   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.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.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)

   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

   at EPiServer.DataAccess.ContentSaveDB.<>c__DisplayClass17_0.b__0()

   at EPiServer.Data.Providers.SqlDatabaseHandler.<>c__DisplayClass29_0.b__0()

   at EPiServer.Data.Providers.SqlDatabaseHandler.<>c__DisplayClass30_0`1.b__0()

   at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method)

   at EPiServer.Core.DefaultContentRepository.DeleteChildren(ContentReference contentLink, Boolean forceDelete, AccessLevel access)

   at EPiServer.Cms.Shell.UI.Rest.WasteBasketStore.Empty(ContentReference id)

   at lambda_method(Closure , ControllerBase , Object[] )


The work arround is 

run this SP in Sql server explorer. (It takes hours in our case) 

EXEC   @return_value = [dbo].[editDeleteChilds]

              @PageID = 2,

              @ForceDelete = 1

I am wondering Can this bug be prioritized and fixed. I can see this bug have a long history.



Jun 14, 2016 17:59

Try to configure <episerver.dataStore> element (NB! changes here are affecting whole site) and set <dataSettings @databaseQueryTimeout>.

It however wasn't affecting necessary SqlCommand settings in this case, maybe that might help in your situation. Just curious..

Jun 14, 2016 22:54

Had some issues with this too. Our workaround was to use the schedule job (Automatic Emptying of Trash) and run it manually a couple of times and then delete the rest by clicking the "Empty Trash"-button.

Jun 15, 2016 8:58

Its a product feature, that should work with large scale websites also without any developers involvement. 


Jun 15, 2016 11:12

keyword is "should"

Jun 15, 2016 11:31

If you still have the database with the trash intact please open a support so we can get access to it. 

Jun 17, 2016 9:31

Hi Per,

Thanks for the response, I will try to arrange that.


Jun 17, 2016 10:13
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.