2

We are encountering the following error frequently in our application.

Problem Id:

System.NullReferenceException at Sitecore.SessionProvider.Redis.StackExchangeClientConnectionAsync+<EvalAsync>d__22.MoveNext

Message: Object reference not set to an instance of an object.

Exception type: System.NullReferenceException

Failed method:

Sitecore.SessionProvider.Redis.StackExchangeClientConnectionAsync+<EvalAsync>d__22.MoveNext

Call Stack:

System.NullReferenceException:
   at System.Object.GetType (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at Sitecore.SessionProvider.Redis.StackExchangeClientConnectionAsync+<EvalAsync>d__22.MoveNext (Sitecore.SessionProvider.Redis, Version=17.0.0.0, Culture=neutral, PublicKeyToken=null)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at Sitecore.SessionProvider.Redis.RedisSessionStateProviderAsync+<SetAndReleaseItemExclusiveAsync>d__20.MoveNext (Sitecore.SessionProvider.Redis, Version=17.0.0.0, Culture=neutral, PublicKeyToken=null)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at Microsoft.AspNet.SessionState.SessionStateModuleAsync+<ReleaseStateAsyncImpl>d__80.MoveNext (Microsoft.AspNet.SessionState.SessionStateModule, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
   at Microsoft.AspNet.SessionState.TaskAsyncHelper.EndTask (Microsoft.AspNet.SessionState.SessionStateModule, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Web.HttpApplication+AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.HttpApplication.ExecuteStepImpl (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
   at System.Web.HttpApplication.ExecuteStep (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)

The application is deployed on Sitecore Managed Cloud Service Azure PaaS and uses Redis app service.

Sitecore Version: 10.2

StackExchange.Redis DLL version: enter image description here

I have followed the below links as well:

Sitecore PAAS Redis Exception

Azure Web App Redis timeout exceptions when under load

Any help, please?

2
  • You need to verify redis server is running properly and please check if redis configuration is correct. Commented Apr 2, 2023 at 8:41
  • Redis server is running properly and configuration is as pe support.sitecore.com/… Commented Apr 3, 2023 at 7:57

1 Answer 1

3

After investigation and Google, we have found that our web.config contains the following settings:

enter image description here

Based on this information we can confirm that the reported behavior is a registered bug.

To track the future status of this bug report, please use reference number 505522.

To workaround this issue, we consider setting aspnet:AllowConcurrentRequestsPerSession to false.

Please note: that it is also not recommended to enable aspnet:AllowConcurrentRequestsPerSession according to Sitecore doc as it might cause unexpected behavior such as data loss. For more information please refer to this documentation: Walkthrough: Configuring a private session state database using the Redis provider

However, if you wish to keep aspnet:AllowConcurrentRequestsPerSession enable, you could consider an upgrade to XP 10.3 as this bug is fully resolved in that version.

For more details see the blog post: Sitecore.SessionProvider.Redis.StackExchangeClientConnectionAsync

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.