`Microsoft.Extensions.Caching.StackExchangeRedis` not working with IPv6 because using an old version of `StackExchange.Redis`
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
Describe the bug
When using Microsoft.Extensions.Caching.StackExchangeRedis on a single-stack IPv6 cluster, we are unable to communicate with a redis database:
Can't access cart storage. StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s). UnableToConnect on redis-cart:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 0s ago, last-write: 0s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 252s ago, v: 2.2.4.27433
at StackExchange.Redis.ConnectionMultiplexer.ConnectImplAsync(ConfigurationOptions, TextWriter ) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 879
at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.ConnectAsync(CancellationToken )
at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAndRefreshAsync(String, Boolean, CancellationToken )
at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAsync(String, CancellationToken )
at cartservice.cartstore.RedisCartStore.GetCartAsync(String) in /app/cartstore/RedisCartStore.cs:line 104
It turns out (like described here) that Microsoft.Extensions.Caching.StackExchangeRedis is using a very old version of StackExchange.Redis: 2.2.4 - defined here. But in 2.6.62 this issue was fixed in StackExchange.Redis. Is there any plan to upgrade that old 2.2.4 to a most recent version in Microsoft.Extensions.Caching.StackExchangeRedis?
Expected Behavior
Microsoft.Extensions.Caching.StackExchangeRedis should work on IPv6 stack.
Steps To Reproduce
You need to have a single-stack IPv6 cluster.
Exceptions (if any)
Can't access cart storage. StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s). UnableToConnect on redis-cart:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 0s ago, last-write: 0s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 252s ago, v: 2.2.4.27433
at StackExchange.Redis.ConnectionMultiplexer.ConnectImplAsync(ConfigurationOptions, TextWriter ) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 879
at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.ConnectAsync(CancellationToken )
at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAndRefreshAsync(String, Boolean, CancellationToken )
at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAsync(String, CancellationToken )
at cartservice.cartstore.RedisCartStore.GetCartAsync(String) in /app/cartstore/RedisCartStore.cs:line 104
.NET Version
7.0.100
Anything else?
- Using
Microsoft.Extensions.Caching.StackExchangeRedis7.0.0 - Used in container,
Dockerfilehere - Code used to call the redis database here using
IDistributedCache
Issue Analytics
- State:
- Created 10 months ago
- Comments:11 (8 by maintainers)
Top Results From Across the Web
Microsoft.Extensions.Caching.StackExchangeRedis How ...
I am using the Microsoft.Extensions.Caching.StackExchangeRedis which works with StackExchange.Redis library underneath to handle all the Redis ...
Read more >Upstash Redis - Questions / Help
Because I was using the client through a microsoft caching package (Microsoft.Extensions.Caching.StackExchangeRedis) I was loading an older ...
Read more >RedisCache Class (Microsoft.Extensions.Caching. ...
Creates a shallow copy of the current Object. (Inherited from Object). Refresh(String). Refreshes a value in the cache based on its key, resetting...
Read more >For upgrading Azure cache for redis 4 to 6 , Do we need ...
1 Answer 1 ... There is no specific version compatibility between Redis and StackExchange.Redis library (see GitHub link). Azure Redis and ...
Read more >Release Notes | StackExchange.Redis
Commands will be queued if a multiplexer isn't yet connected to a Redis server. · Commands will be queued if a connection is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Absolutely, but IMO we should combine this with reinvigorating the test suite for this scenario.
Closed, completed by #45261