ExecuteReader requires an open and available Connection Exception in EPiServer.DataAccess.Internal.ContentLoadDB

Vote:
 

I see this in a site I'm analyzing with Application Insights from various stored procedure calls, some examples are netContentListPaged, netContentDataLoad and netContentChildrenReferences.

ExecuteReader requires an open and available Connection. The connection's current state is open.

System.InvalidOperationException:
   at System.Data.SqlClient.SqlConnection.GetOpenConnection (System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute (System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Data.SqlClient.SqlCommand.ValidateCommand (System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader (System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader (System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Data.SqlClient.SqlCommand.ExecuteReader (System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at EPiServer.DataAccess.Internal.ContentLoadDB+<>c__DisplayClass2_0.<Load>b__0 (EPiServer, Version=11.20.3.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor+<>c__DisplayClass31_0`1.<Execute>b__0 (EPiServer.Data, Version=11.20.3.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute (EPiServer.Data, Version=11.20.3.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   at EPiServer.Core.ContentProvider+<>c__DisplayClass127_0.<LoadContentFromCacheOrRepository>b__0 (EPiServer, Version=11.20.3.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   at EPiServer.Framework.Cache.ObjectInstanceCacheExtensions.ReadThroughWithWait (EPiServer.Framework, Version=11.20.3.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   at EPiServer.Core.Internal.ContentInstanceCache.ReadThrough (EPiServer, Version=11.20.3.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   at EPiServer.Core.ContentProvider.LoadContentFromCacheOrRepository (EPiServer, Version=11.20.3.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   at EPiServer.Core.Internal.ProviderPipelineImplementation.GetItem (EPiServer, Version=11.20.3.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   at EPiServer.Core.Internal.DefaultContentLoader.TryGet (EPiServer, Version=11.20.3.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   
Looking at the code triggering above stacktracke I see a typical contentRepository.TryGet<ImageMedia>(imageReference, out var image) call where ImageMedia is a class that inherits ImageData.

Site is running .NET 4.7.1 and 11.20.3.0 as you can see above.

Any one seen similar and found a solution?

#251221
Edited, Mar 23, 2021 22:14
Vote:
 

Hello Johan,

We are facing same issue now you found any solution to this if so please share that will be greatful.

Thanks,

Deepa

#259170
Jul 20, 2021 5:33
* 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.