When connecting to Redis via Sentinel in non-admin mode (allowAdmin=false), the library tries to confirm the server is the master by executing a ROLE command. However, this ROLE command is in the StackExchange.Redis.Message.isAdmin list, resulting in the command not being executed and returning a RedisCommandException.
StackExchange.Redis version 2.2.4 (introduced in 2.2.3)
Relevant Stacktrace:
StackExchange.Redis.RedisCommandException: This operation is not available unless admin mode is enabed: ROLE
at StackExchange.Redis.ConnectionMultiplexer.CheckMessage(Message message) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 524
at StackExchange.Redis.RedisBase.ExecuteSync[T](Message message, ResultProcessor`1 processor, ServerEndPoint server) in /_/src/StackExchange.Redis/RedisBase.cs:line 54
at StackExchange.Redis.RedisServer.ExecuteSync[T](Message message, ResultProcessor`1 processor, ServerEndPoint server) in /_/src/StackExchange.Redis/RedisServer.cs:line 614
at StackExchange.Redis.RedisServer.Role(CommandFlags flags) in /_/src/StackExchange.Redis/RedisServer.cs:line 346
at StackExchange.Redis.ConnectionMultiplexer.GetSentinelMasterConnection(ConfigurationOptions config, TextWriter log) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 2405
at StackExchange.Redis.ConnectionMultiplexer.SentinelMasterConnectAsync(ConfigurationOptions configuration, TextWriter log) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 1128
at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.ConnectAsync(CancellationToken token)
at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAndRefreshAsync(String key, Boolean getData, CancellationToken token)
at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAsync(String key, CancellationToken token)
at Microsoft.Extensions.Caching.Distributed.DistributedCacheExtensions.GetStringAsync(IDistributedCache cache, String key, CancellationToken token)
K, we should take that out of the admin list, I suspect.
On Fri, 27 Nov 2020, 12:55 TimTuijn, notifications@github.com wrote:
When connecting to Redis via Sentinel in non-admin mode (allowAdmin=false),
the library tries to confirm the server is the master by executing a ROLE
command. However, this ROLE command is in the
StackExchange.Redis.Message.isAdmin list, resulting in the command not
being executed and returning a RedisCommandException.StackExchange.Redis version 2.2.4 (introduced in 2.2.3)
Relevant Stacktrace:
StackExchange.Redis.RedisCommandException: This operation is not available unless admin mode is enabed: ROLEat StackExchange.Redis.ConnectionMultiplexer.CheckMessage(Message message) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 524at StackExchange.Redis.RedisBase.ExecuteSyncT in /_/src/StackExchange.Redis/RedisServer.cs:line 614at StackExchange.Redis.RedisServer.Role(CommandFlags flags) in /_/src/StackExchange.Redis/RedisServer.cs:line 346at StackExchange.Redis.ConnectionMultiplexer.GetSentinelMasterConnection(ConfigurationOptions config, TextWriter log) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 2405at StackExchange.Redis.ConnectionMultiplexer.SentinelMasterConnectAsync(ConfigurationOptions configuration, TextWriter log) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 1128at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.ConnectAsync(CancellationToken token)at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAndRefreshAsync(String key, Boolean getData, CancellationToken token)at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAsync(String key, CancellationToken token)at Microsoft.Extensions.Caching.Distributed.DistributedCacheExtensions.GetStringAsync(IDistributedCache cache, String key, CancellationToken token)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/StackExchange/StackExchange.Redis/issues/1628, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AAAEHMC7Y32OUR4OZKS6D5LSR6OSVANCNFSM4UE4C2ZQ
.
I got same problem. Please help me solve the issue
The unit tests of sentinel.cs all use AllowAdmin=true in the connection string or configuration object. With the introduction of sentinel mode in recent releases I think that forking the cases with AllowAdmin=false could better help prevent from showstopper like this one.
Any estimates on this issue?
Verified working in 2.2.11
@TimTuijn curios, is there any other nuget feed? since https://www.nuget.org/packages/StackExchange.Redis/ and https://stackexchange.github.io/StackExchange.Redis/ReleaseNotes has 2.2.4 and i don't see 2.2.11 there
@sergey-litvinov if you look at the top page here, you could find https://www.myget.org/gallery/stackoverflow with current version 2.2.20 but it's introduced as pre-release, so the question to @mgravell: do you have any plans to continue with nuget, or we can treat that myget as the official production-ready repository?
@dfrunet oh, totally missed it. thanks!
@sergey-litvinov you can nuget Install-Package with 2.2.14 or 2.2.11 specified. It is not "visible" in nuget web site but it is indeed there.
Most helpful comment
I got same problem. Please help me solve the issue