Skip to content

NOAUTH Authentication required ERROR after ElastiCache patch #1273

@bdlee420

Description

@bdlee420

Redis Setup

  1. ElastiCache Redis
  2. Clustered
  3. SSL
  4. Version 3.2.6
  5. Redis AUTH = Yes

Client

  1. C# .Net Core console application
  2. StackExchange.Redis: 2.0.601

Occasionally there are AWS updates applied to our Redis instance for ElastiCache. When this updates applies, all of our clients that use the StackExchance.Redis library start to receive "StackExchange.Redis.RedisServerException: NOAUTH Authentication required." errors. We have to restart the clients and then everything works fine.

We have been unable to duplicate this issue outside of an ElastiCache service update.

Things we have tried to duplicate the issue:

  1. Shutdown Redis and restart it
  2. Upgrade the version
  3. Change SSL settings back and forth

In all these cases, the local client reconnected with no problems.

We are at a lose as to how to duplicate this issue and then how to resolve this issue. One thought I had was to create a heartbeat inside each client to try to connect and read a key, if it fails, then rebuild the connection to Redis, but we are blind since we can't duplicate it on demand. Any help would be greatly appreciated.

Our Redis provider constructor

public RedisProvider(RedisConnectionSettings connectionSettings, ILogger logger)
        {
            options = new ConfigurationOptions()
            {
                Ssl = connectionSettings.SslEnabled,
                DefaultDatabase = connectionSettings.Database,
                Password = connectionSettings.Password,
                EndPoints = { connectionSettings.Connection }
            };

            try
            {
                connectionMultiplexer = ConnectionMultiplexer.Connect(options);
            }
            catch (Exception ex)
            {
                logger.Error(ex.Message);
            }
            keysPrefix = $"{connectionSettings.KeyPrefix}:{_redisApplicationName}";
}

Our method to get the Redis Database used in each call to Redis

private IDatabase GetRedisDataBase()
{
            if (connectionMultiplexer == null)
            {
                connectionMultiplexer = ConnectionMultiplexer.Connect(options);
            }

            var redisDatabase = connectionMultiplexer.GetDatabase();

            return redisDatabase;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions