question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`Microsoft.Extensions.Caching.StackExchangeRedis` not working with IPv6 because using an old version of `StackExchange.Redis`

See original GitHub issue

Is 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?

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
mgravellcommented, Dec 6, 2022

Absolutely, but IMO we should combine this with reinvigorating the test suite for this scenario.

0reactions
mgravellcommented, Mar 30, 2023

Closed, completed by #45261

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found