I have a site that is on latest 7.15.4 it is a couple of years old so gone through several generations of upgrades.
Also runs merchello. It is a reasonably busy site as well and hosted in azure.
I am struggling to track down the cause, would anyone have any suggestions on where to look?
I am getting one of these 2 errors complaining about the sql connection connection or timing out.
System.InvalidOperationException: ExecuteReader requires an open and
available Connection. The connection's current state is open. at
System.Data.SqlClient.SqlConnection.GetOpenConnection(String method)
at
System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String
method, SqlCommand command) at
System.Data.SqlClient.SqlCommand.ValidateCommand(String method,
Boolean async) 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.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
method) at
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
behavior, String method) at
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior
behavior) at
System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
at
StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteDbDataReader(CommandBehavior
behavior) at
System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
at
StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteDbDataReader(CommandBehavior
behavior) at
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
at
Umbraco.Core.Persistence.PetaPocoCommandExtensions.<>c__DisplayClass5_0.<ExecuteReaderWithRetry>b__0()
at
Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func1
func) at
Umbraco.Core.Persistence.PetaPocoCommandExtensions.ExecuteReaderWithRetry(IDbCommand
command, RetryPolicy cmdRetryPolicy, RetryPolicy conRetryPolicy) at
Umbraco.Core.Persistence.PetaPocoCommandExtensions.ExecuteReaderWithRetry(IDbCommand
command, RetryPolicy retryPolicy) at
Umbraco.Core.Persistence.PetaPocoCommandExtensions.ExecuteReaderWithRetry(IDbCommand
command) at
Umbraco.Core.Persistence.Database.
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, Action1 wrapCloseInAction) at
System.Data.SqlClient.SqlInternalConnection.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.SqlDataReader.TryConsumeMetaData() at
System.Data.SqlClient.SqlDataReader.getMetaData() 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, 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
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior
behavior) at
System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
at
StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteDbDataReader(CommandBehavior
behavior) at
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
at
Umbraco.Core.Persistence.PetaPocoCommandExtensions.<>cDisplayClass50.
var repositoryFactory = new RepositoryFactory();
IScopeUnitOfWorkProvider uowProvider = new etaPocoUnitOfWorkProvider();
using (var uow = uowProvider.GetUnitOfWork(readOnly: true))
{
using (var repository = repositoryFactory.CreateContentRepository(uow))
{
var x = repository.GetAll(guids);
}
}
SQL Connection errors
I have a site that is on latest 7.15.4 it is a couple of years old so gone through several generations of upgrades.
Also runs merchello. It is a reasonably busy site as well and hosted in azure.
I am struggling to track down the cause, would anyone have any suggestions on where to look?
I am getting one of these 2 errors complaining about the sql connection connection or timing out.
Hi did you reach something about this? I'm trapped also.
With reference to this
The below should work
And supported in async as well.
No, I think I scaled the DB up so allowed more connections
is working on a reply...