Azure Redis connection error from .net core console application

Chinnadurai, Palpantian 1 Reputation point
2020-10-17T12:46:52.37+00:00

I am exploring Azure redis cache to use one of our application. I create a .net Core (3.1) Console application as given in the article https://learn.microsoft.com/en-us/azure/azure-cache-for-redis/cache-dotnet-core-quickstart

while i running the app am getting the below error

StackExchange.Redis.RedisConnectionException
HResult=0x80131500
Message=No connection is active/available to service this operation: SET Message; UnableToConnect on fis-prepaid-test-redis.cache.windows.net:6380/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: 1s ago, v: 2.1.58.34321, mc: 1/1/0, mgr: 10 of 10 available, clientName: xxxxxxxxx, IOCP: (Busy=0,Free=1000,Min=4,Max=1000), WORKER: (Busy=0,Free=32767,Min=4,Max=32767), v: 2.1.58.34321
Source=StackExchange.Redis
StackTrace:
at StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T](Message message, ResultProcessor1 processor, ServerEndPoint server) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 2810 at StackExchange.Redis.RedisBase.ExecuteSync[T](Message message, ResultProcessor1 processor, ServerEndPoint server) in /_/src/StackExchange.Redis/RedisBase.cs:line 54
at StackExchange.Redis.RedisDatabase.StringSet(RedisKey key, RedisValue value, Nullable`1 expiry, When when, CommandFlags flags) in /_/src/StackExchange.Redis/RedisDatabase.cs:line 2500
at RedisAzure.Program.Main(String[] args) in E:\RnT\DistributedCache\RedisAzure\Program.cs:line 28
This exception was originally thrown at this call stack:
[External Code]
Inner Exception 1:
RedisConnectionException: UnableToConnect on fis-prepaid-test-redis.cache.windows.net:6380/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: 1s ago, v: 2.1.58.34321

I am using Azure Visual studio subscription for this test application.

Please help why this error occurred. is there any option to check if the request kit the Azure redis or not.

Azure Cache for Redis
Azure Cache for Redis
An Azure service that provides access to a secure, dedicated Redis cache, managed by Microsoft.
262 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Chinnadurai, Palpantian 1 Reputation point
    2020-10-20T17:37:18.647+00:00

    Hi @anurag Sharma

    When i update StackExchange.Redis to 2.1.58, i am getting the below error:

    Restoring packages for E:\RnT\Test\Redistest\Redistest.csproj...
    NU1605: Detected package downgrade: System.Buffers from 4.5.1 to 4.5.0. Reference the package directly from the project to select a different version.
    Redistest -> StackExchange.Redis 2.1.58 -> Pipelines.Sockets.Unofficial 2.1.16 -> System.Buffers (>= 4.5.1)
    Redistest -> System.Buffers (>= 4.5.0)
    NU1605: Detected package downgrade: System.Runtime.CompilerServices.Unsafe from 4.7.1 to 4.5.2. Reference the package directly from the project to select a different version.
    Redistest -> StackExchange.Redis 2.1.58 -> Pipelines.Sockets.Unofficial 2.1.16 -> System.Runtime.CompilerServices.Unsafe (>= 4.7.1)
    Redistest -> System.Runtime.CompilerServices.Unsafe (>= 4.5.2)
    Package restore failed. Rolling back package changes for 'Redistest'.

    System.Buffer and System.Runtime.CompilerServices.UnSafe is really required ?

    Please advise.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.