0

I'm trying with Sitecore 8.2 and Sitecore 9.0.2 to change the session state provider from inproc to AWS hosted Redis session provider and get the following exception:

[RedisConnectionException: No connection is available to service this operation: EVAL] StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl(Message message, ResultProcessor1 processor, ServerEndPoint server) +690 StackExchange.Redis.RedisBase.ExecuteSync(Message message, ResultProcessor1 processor, ServerEndPoint server) +122 StackExchange.Redis.RedisDatabase.ScriptEvaluate(String script, RedisKey[] keys, RedisValue[] values, CommandFlags flags) +141 Sitecore.SessionProvider.Redis.<>c__DisplayClass12_0.b__0() +55 Sitecore.SessionProvider.Redis.StackExchangeClientConnection.RetryForScriptNotFound(Func1 redisOperation) +140 Sitecore.SessionProvider.Redis.StackExchangeClientConnection.RetryLogic(Func1 redisOperation) +144 Sitecore.SessionProvider.Redis.StackExchangeClientConnection.Eval(String script, String[] keyArgs, Object[] valueArgs) +609 Sitecore.SessionProvider.Redis.RedisConnectionWrapper.TryTakeWriteLockAndGetData(String sessionId, DateTime lockTime, Object& lockId, ISessionStateItemCollection& data, Int32& sessionTimeout) +352 Sitecore.SessionProvider.Redis.RedisSessionStateProvider.GetItemFromSessionStore(Boolean isWriteLockRequired, HttpContext context, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actions) +1113 Sitecore.SessionProvider.Redis.RedisSessionStateProvider.GetItemExclusive(HttpContext context, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actions) +225 System.Web.SessionState.SessionStateModule.GetSessionStateItem() +169 System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +1002 System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +689 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +213 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +131

This is what I changed in my web.config (Sitecore 8.2):

<sessionState mode="Custom" customProvider="redis" timeout="20">
    <providers>
        <add name="redis" type="Sitecore.SessionProvider.Redis.RedisSessionStateProvider,Sitecore.SessionProvider.Redis" connectionString="session" pollingInterval="2" applicationName="private"/>         
    </providers>
</sessionState>

This is the AWS Redis endpoint defined in my connectionString.config (Sitecore 8.2)

<add name="session" connectionString="example.cache.amazonaws.com:6000,password=xxxx,ssl=true,abortConnect=False" />

I am doubting that StackExchange.Redis version used by Sitecore.SessionProvider.Redis is 1.0.488 and this maybe the cause of the issue.

I wonder if anyone else has come across a similar exception using Redis provider on AWS. Appreciate any pointers to troubleshoot the issue.

UPDATED: Sitecore logs showing connection to Redis

33488 15:15:31 INFO All tasks are already complete 33488 15:15:31 INFO example.cache.amazonaws.com:6000 failed to nominate (Faulted) 33488 15:15:31 INFO > UnableToResolvePhysicalConnection on GET 33488 15:15:31 INFO No masters detected 33488 15:15:31 INFO example.cache.amazonaws.com:6000 Cluster v4.0.10, slave; keep-alive: 00:01:00; int: Connecting; sub: ConnectedEstablished, 1 active; not in use: DidNotRespond 33488 15:15:31 INFO example.cache.amazonaws.com:6000: int ops=8, qu=0, qs=0, qc=2, wr=0, sync=9, socks=2; sub ops=4, qu=0, qs=0, qc=0, wr=0, subs=1, sync=4, socks=1 33488 15:15:31 INFO Circular op-count snapshot; int: 0+8=8 (0.80 ops/s; spans 10s); sub: 0+4=4 (0.40 ops/s; spans 10s) 33488 15:15:31 INFO Sync timeouts: 0; fire and forget: 0; last heartbeat: -1s ago 33488 15:15:31 INFO resetting failing connections to retry... 33488 15:15:31 INFO retrying; attempts left: 2... 33488 15:15:31 INFO 1 unique nodes specified 33488 15:15:31 INFO Requesting tie-break from example.cache.amazonaws.com:6000 > __Booksleeve_TieBreak... 33488 15:15:31 INFO Allowing endpoints 00:00:05 to respond... 33488 15:15:31 INFO Awaiting task completion, IOCP: (Busy=1,Free=999,Min=4,Max=1000), WORKER: (Busy=4,Free=32763,Min=4,Max=32767) 33488 15:15:31 INFO All tasks completed cleanly, IOCP: (Busy=1,Free=999,Min=4,Max=1000), WORKER: (Busy=3,Free=32764,Min=4,Max=32767) 33488 15:15:31 INFO example.cache.amazonaws.com:6000 returned, but incorrectly 33488 15:15:31 INFO Awaiting task completion, IOCP: (Busy=1,Free=999,Min=4,Max=1000), WORKER: (Busy=3,Free=32764,Min=4,Max=32767) 29412 15:15:31 INFO Not all tasks completed cleanly, IOCP: (Busy=0,Free=1000,Min=4,Max=1000), WORKER: (Busy=2,Free=32765,Min=4,Max=32767) 29412 15:15:31 INFO example.cache.amazonaws.com:6000 failed to nominate (WaitingForActivation) 29412 15:15:31 INFO No masters detected

  • We have this working but there can be many reasons for this to happen. Do you see any connections when you look at Redis in AWS console? When Sitecore starts it will ping Redis, what is the result of this in this Sitecore log? – Jeroen Nov 1 '18 at 18:48
  • Thanks @Jeroen for your response. I am yet to see the AWS console but on Sitecore logs I see it gets authenticated and connected but after that it tries to ping where it says No Master detected. I have updated my Post with sitecore logs – Mohit Nov 1 '18 at 19:22
  • 1
    One thing you could try is to change the Redis engine version from v4.0.10 to 3.2.6, this is what we are using and is closest to version 3.2.7 which is used by Azure's Redis engine. – Jeroen Nov 2 '18 at 2:29
  • Thanks @Jeroen, downgrading to 3.2.6 version worked. – Mohit Nov 14 '18 at 22:23
1

I think you also should change the shared session state as per Sitecore's documentation as having them different could cause this issue and other issues.

|improve this answer|||||
  • Thanks Mark for the input but that did not help. I see the same exception and sitecore logs – Mohit Nov 2 '18 at 0:03
0

Sitecore Support responded that their current StackExchange library does not support 4.0.10 version. After downgrading the Redis engine to 3.2.6, we were able to configure Redis session.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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