FALM-Umbraco-Projects / FALM-Housekeeping-v7

Package for Umbraco 7 - This package create a new custom section with this tools: Umbraco logs manager, Media folder cleanup, Delete users and Version manager
https://our.umbraco.org/projects/backoffice-extensions/falm-housekeeping/
MIT License
8 stars 6 forks source link

Exception when clearing versions on upgraded site #60

Closed craigs100 closed 5 years ago

craigs100 commented 6 years ago

Exception when using Versions Manager v7.7.2.4 on a DB upgraded from 7.0.4 to 7.12.3 (but a fresh install of 7.12.3 files) with 1,920 versions. Occurs when using "Cleanup all Versions" or "Cleanup versions by count".

This was a virgin install of the package. The timeout occurred after 30 seconds and it's running as an Azure web app.

Exception (8dd06614). System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 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, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) 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, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Umbraco.Core.Persistence.PetaPocoCommandExtensions.<>c__DisplayClass2_0.<ExecuteNonQueryWithRetry>b__0() at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func1 func) at Umbraco.Core.Persistence.Database.Execute(String sql, Object[] args) ClientConnectionId:2d58983a-3470-4c57-993f-7421ed2a4ac2 Error Number:-2,State:0,Class:11

afabri73 commented 6 years ago

Hi Craigs100, I tried my package on two websites with over 2000 versions to delete (for both of them) One website use SQL Server DB and the second one use a SQL CE DB and for both I haven't encountered timeout problems. I haven't an Azure Platform so I cannot test it.

In my code I set the HttpContext.Current.Server.ScriptTimeout to 10000.

You can also try to extend the SQL Connection Timeout by changing the connection string in the web.config as this (example): <add name="umbracoDbDSN" connectionString="server=(local);database=Umbraco_v7;user id=umbraco;password=umbraco;Connection Timeout=3600" providerName="System.Data.SqlClient" />

The timeout value is expressed in seconds. If this property isn't set, the default timeout value should be 15 seconds.

Hope this help :-) Adriano

afabri73 commented 6 years ago

Have you solved the problem?

craigs100 commented 6 years ago

Hi, No sorry, we had to get moving so we gave up and started the upgrades again from scratch without the package.