1
votes

We're receiving the following error in ServiceStack.Redis v4.0.48

System.IndexOutOfRangeException: Index was outside the bounds of the array. at ServiceStack.Redis.RedisManagerPool.GetClient() at ServiceStack.Redis.RedisClientManagerCacheClient.Set[T](String key, T value, TimeSpan expiresIn) at ServiceStack.ServiceExtensions.CacheSet[T](ICacheClient cache, String key, T value, Nullable1 expiresIn) at ServiceStack.ServiceStackHost.OnSaveSession(IRequest httpReq, IAuthSession session, Nullable1 expiresIn) at ServiceStack.Auth.OAuthProvider.Authenticate(IServiceBase authService, IAuthSession session, Authenticate request) at ServiceStack.Auth.AuthenticateService.Authenticate(Authenticate request, String provider, IAuthSession session, IAuthProvider oAuthConfig) at ServiceStack.Auth.AuthenticateService.Post(Authenticate request) at ServiceStack.Host.ServiceRunner`1.Execute(IRequest request, Object instance, TRequest requestDto)

We've tried bumping pool count up to 128 (across 3 instances) but that didn't resolve. Hoping to attract the attention of someone who has encountered this and can provide some direction on what might be going on...

Please let me know what additional information is necessary to diagnose.

1
Can you try upgrading to the latest v4.0.52 to see if that resolves the issue? - mythz
is it possible to upgrade just ServiceStack.Redis or do we need to upgrade all components to be on the same version? - josh-sachs
All packages in the solution need to be upgraded to the same version. - mythz
We've upgraded and now we are seeing a new issue, it may be related to the redis retry logic... A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond at System.Net.Sockets.Socket.Connect(IPAddress[] addresses, Int32 port) at System.Net.Sockets.Socket.Connect(String host, Int32 port) at ServiceStack.Redis.RedisNativeClient.Connect() at ServiceStack.Redis.RedisNativeClient.TryConnectIfNeeded() at ServiceStack.Redis.RedisNativeClient.AssertConnectedSocket() - josh-sachs
This error seems transient - which was resolved for us by the retry logic last time we upgraded... not sure if this is a regression. - josh-sachs

1 Answers

1
votes

The first comment to upgrade to 4.0.52 from @mythz ultimately was the solution, however it is important to note that the upgrade changes the behavior of Redis configuration - particularly as it relates to Redis connection strings.

for 4.0.52 anyway, you must set default values on RedisConfig (e.g. RedisConfig.DefaultRetryTimeout), even if you set the equivalent values within the connection string.