Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

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


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.

   at System.Data.SqlClient.SqlConnection.GetOpenConnection (System.Data, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute (System.Data, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Data.SqlClient.SqlCommand.ValidateCommand (System.Data, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader (System.Data, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader (System.Data, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Data.SqlClient.SqlCommand.ExecuteReader (System.Data, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at EPiServer.DataAccess.Internal.ContentLoadDB+<>c__DisplayClass2_0.<Load>b__0 (EPiServer, Version=, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   at EPiServer.Data.Providers.Internal.SqlDatabaseExecutor+<>c__DisplayClass31_0`1.<Execute>b__0 (EPiServer.Data, Version=, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute (EPiServer.Data, Version=, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   at EPiServer.Core.ContentProvider+<>c__DisplayClass127_0.<LoadContentFromCacheOrRepository>b__0 (EPiServer, Version=, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   at EPiServer.Framework.Cache.ObjectInstanceCacheExtensions.ReadThroughWithWait (EPiServer.Framework, Version=, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   at EPiServer.Core.Internal.ContentInstanceCache.ReadThrough (EPiServer, Version=, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   at EPiServer.Core.ContentProvider.LoadContentFromCacheOrRepository (EPiServer, Version=, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   at EPiServer.Core.Internal.ProviderPipelineImplementation.GetItem (EPiServer, Version=, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)
   at EPiServer.Core.Internal.DefaultContentLoader.TryGet (EPiServer, Version=, 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 as you can see above.

Any one seen similar and found a solution?

Edited, Mar 23, 2021 22:14

Hello Johan,

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



Jul 20, 2021 5:33

Hi, just bumping this thread. I recently upgraded a site from 11.20.0 to 11.20.17 (in non-prod only so far) and I'm now seeing this error regularly.

It typically happens when various scheduled jobs start (but not always - it's erratic),  - e.g., the link validation job or 'delayed publish job' appear often in the logs:

ERROR EPiServer.DataAbstraction.ScheduledJob: Job EPiServer.LinkAnalyzer.LinkValidationJob failed for the job 'Link Validation' with jobId ='<SOME GUID>' 
System.InvalidOperationException: ExecuteReader requires an open and available Connection. The connection's current state is closed.

Just wondering if anyone has further information. I'd rather know if there's an issue before pushing the upgrade to production.


Jan 19, 2023 0:20

Running into very similar errors while running the Search & Navigation Indexing Job on Episerver.Cms v12.22.3. Issue occured our of the blue after doing a database migration from a Cms 11 instance of the project.

      An exception occurred while fetching content. ExecuteReader requires an open and available Connection. The connection's current state is open..

Not sure if it's related but I'm currious if anyone found a solution.

Aug 23, 2023 13:49

My issue turned out to be a bug in Episerver.Framework 12.16.0 / Episerver.Cms 12.22.3. Once I downgraded to 12.22.1 the Search & Navigation Content Indexing Job started to work again. Assuming it has to do with the new Inline Block functionality.

Aug 23, 2023 18:04

Thank you Sam for contributing.
We are currently working on a fix for this.

Aug 24, 2023 7:32

This will be fixed with next CMS and Find package

CMS-29569 BackgroundContext should be isolated

FIND-11746 Background tasks should run in own context
(Bug not made public yet)

Aug 28, 2023 15:58
Johnny Mullaney - Dec 15, 2023 11:06
We're having a similar issue with Find.

Do you have more details on FIND-11746 - i cant find a bug in the list?
dada - Dec 15, 2023 15:41
Hi Johnny

FIND-11746 is associated with Find 15.2

15.2 was delisted due to other problems but this fix is available from Find 16 but I recommend the latest 16.0.1
Seems to be an issue with release notes associated with delisted packages. I will bring this up with engineering.
Johnny Mullaney - Dec 18, 2023 11:42
thank you for the update Daniel!

CMS-29569 BackgroundContext should be isolated was part of 12.17.1 released yesterday.

More info:

Sep 01, 2023 5:43
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.