Sitecore.SessionProvider.Redis.StackExchangeClientConnectionAsync
We had encounter 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) |
StackExchange.Redis DLL version: 2.1.58
The application is deployed on Sitecore Managed Cloud Service Azure PaaS and uses Redis app service.
I have applied the below fixes as well as the following articles but the issue is not resolved:
- Increased the min worker thread pool to 100
- Increased polling Interval to 60
- Tuned Redis Configuration as described here: Tuning Redis Configuration Settings
- Added sslprotocols=tls12 to Redis connection string
- Sitecore PAAS Redis Exception
- Azure Web App Redis timeout exceptions when under load
Solution:
After investigation and Google, we have found that our web.config contains the following settings:
<add applicationname="private" compression="true" connectionpoolsize="1"
connectionstring="redis.sessions" connectiontimeoutinmilliseconds="3000"
name="redis" operationtimeoutinmilliseconds="5000" pollinginterval="60"
pollingmaxexpiredsessionspersecond="20" retrytimeoutinmilliseconds="16000"
type="Sitecore.SessionProvider.Redis.RedisSessionStateProviderAsync,
Sitecore.SessionProvider.Redis"/>
<add key="aspnet:AllowConcurrentRequestsPerSession" value="true"/>
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. More information about public reference numbers can be found here: How to use public reference numbers
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.
Happy Sitecoreing 😊
Comments
Post a Comment