Unable to connect to Azure Redis through StackExchange.Redis

Caution: Okay, this is strange, and I'm not sure if SO is the right place.

I have an Azure site linking an Azure Redis cache instance. (using StackExchange.Redis)

Everything was great, and once - the website does not connect to Redis.

Error:

Failed to connect to redis servers; to create a disabled multiplexer, disable AbortOnConnectFail. Socketfailure on ping

Here is my connection string:

mycache.redis.cache.windows.net, SSL = true, password = xxxxxx, syncTimeout = 5000

Here are my steps:

  • Try connecting from local to Azure Redis. Result: SUCCESS (so the code is good?)
  • Try and roll out a new instance of Azure Redis, connect to Azure. Result: FAIL (the website cannot connect to ANY azure instance of Redis?)
  • Spinup NEW Azure Website with the same code as the error code pointing to the existing Redis cache. Result: SUCCESS (um, what?)
  • Download the new MVC website, add StackExchange.Redis, deploy to the new Azure website by connecting to Redis. Result: SUCCESS (so is Redis good?)
  • Expand your existing Azure website above the Vanilla MVC website (just like code 4, connecting to the same Redis, the only difference is using the old Azure Website physical machine / network). Result: FAIL (wtf ??)

So - I think Radish has a blacklist on the Azure website? (maybe this is possible?) I know that the client (my code) will not try to recreate it, but I have repeatedly looked for the site and it simply cannot connect to Redis.

The fact that deploying a new Azure website with the same code associated with the same Redis instance leads to success tells me that there was some kind of blacklist / routing issue in Azure / Redis.

Any ideas?

EDIT

Looks like a problem in Azure VNET. When my site is part of the Azure Virtual Network, it cannot connect to Redis. But when I take it out of the network, it connects perfectly. Until today, this setting has worked fine.

So, is it interesting that Azure made changes so that VNET websites could not connect to Azure Redis? (I don't know the point)

EDIT 2:

Attached logs from an attempt to connect Redis.

Exception: it was not possible to connect to redis servers; To create a disconnected multiplexer, disable AbortOnConnectFail. SocketFailure on PING connection string-deleted : 6380, password = password removed , SSL = True Remote connection : 6380 / Interactive ... BeginConnect: remote line : 6380 1 unique node Indicated request to disconnect from remote connection : 6380

__ Booksleeve_TieBreak ... Allow endpoints 00:00:05 to respond ... Waiting for the task to complete, IOCP: (Busy = 0, Free = 1000, Min = 1, Max = 1000), WORKER: (Busy = 4, Free = 32763, Min = 1, Max = 32767) Not all tasks were completed cleanly, IOCP: (Busy = 0, Free = 1000, Min = 1, Max = 1000), WORKER: (Busy = 5, Free = 32762, Min = 1, Max = 32767) deleted row-to-row : 6380 did not respond Waiting for the task to complete, IOCP: (Busy = 0, Free = 1000, Min = 1, Max = 1000), WORKER: (Busy = 5, Free = 32762, Min = 1, Max = 32767) Not all tasks were performed cleanly, IOCP: (Busy = 0, Free = 1000, Min = 1, Max = 1000), WORKER: (Busy = 5, Free = 32762, Min = 1, Max = 32767) deleted row-to-row : 6380 could not be assigned (WaitingForActivation) No masters found ud Allen line : 6380: Standalone v2.0.0, master; keep-alive: 00:01:00; int: connection; sub: connection; not used: DidNotRespond deleted line : 6380: int ops = 0, qu = 2, qs = 0, qc = 0, wr = 0, socks = 1; sub ops = 0, qu = 0, qs = 0, qc = 0, wr = 0, socks = 1 Digital snapshot count; int: 0 (0.00 ops / s; spans 10 s); sub: 0 ​​(0.00 ops / s; duration 10 s) Synchronization timeouts: 0; fire and forget: 0; last heartbeat: -1s ago reset failed connections to retry ... retrying; attempts left: 2 ... 1 unique nodes specified Request a tie-break from line-to-remote connection : 6380> __Booksleeve_TieBreak ... Allows endpoints 00:00:05 to respond ... Waiting for the task to complete, IOCP: (Busy = 0 , Free = 1000, Min = 1, Max = 1000), WORKER: (Busy = 6, Free = 32761, Min = 1, Max = 32767) Not all tasks were completed cleanly, IOCP: (Busy = 0, Free = 1000, Min = 1, Max = 1000), WORKER: (Busy = 7, Free = 32760, Min = 1, Max = 32767) deleted line : 6380 did not respond Waiting for the task to complete, IOCP: (Busy = 0, Free = 1000, Min = 1, Max = 1000), WORKER: (Busy = 7, Free = 32760, Min = 1, Max = 32767). Not all tasks are performed cleanly, IOCP: (Busy = 0, Free = 1000, Min = 1, Max = 1000), WORKER: (Busy = 7, Free = 32760, Min = 1, Max = 32767) deleted line : 6380 not failed to assign (WaitingForActivation) No masters detected; remote line : 6380: Standalone v2.0.0, master; keep-alive: 00:01:00; int: connection; sub: connection; not used: DidNotRespond deleted line : 6380: int ops = 0, qu = 2, qs = 0, qc = 0, wr = 0, async = 3, socks = 2; sub ops = 0, qu = 0, qs = 0, qc = 0, wr = 0, socks = 2 snapshot with a circular count; int: 0 (0.00 ops / s; spans 10 s); sub: 0 ​​(0.00 ops / s; spans 10s) Sync timeouts: 0; fire and forget: 0; last beating: -1s ago reset of failed connections for retrying ... repetition; attempts remained: 1 ... 1 unique nodes specified in the tie-break request from the remote connection : 6380> __Booksleeve_TieBreak ... Allow endpoints 00:00:05 for the answer ... Waiting for the task to complete, IOCP: (Busy = 0 , Free = 1000, Min = 1, Max = 1000), WORKER: (Busy = 8, Free = 32759, Min = 1, Max = 32767) EndConnect: remote line : 6380 (socket termination). Connect termination: deleted line. : 6380. All tasks were performed cleanly, IOCP: (Busy = 0, Free = 1000, Min = 1, Max = 1000), WORKER: (Busy = 11, Free = 32756, Min = 1, Max = 32767) deleted line : 6380 failure: SocketFailure on PING Waiting for task completion, IOCP: (Busy = 0, Free = 1000, Min = 1, Max = 1000), WORKER: (Busy = 11, Free = 32756, Min = 1, Max = 32767) Not all tasks completed cleanly, IOCP: (Busy = 0, Free = 1000, Min = 1, Max = 1000), WORKER: (Busy = 7, Free = 32760, Min = 1, Max = 32767) deleted line : 6380 failed assign (WaitingForActivation) No masters detected; remote line : 6380: Standalone v2.0.0, master; keep-alive: 00:01:00; int: connection; sub: connection; not used: DidNotRespond deleted line : 6380: int ops = 0, qu = 2, qs = 0, qc = 0, wr = 0, async = 7, socks = 3; sub ops = 0, qu = 0, qs = 0, qc = 0, wr = 0, socks = 3 snapshot of the loop; int: 0 (0.00 ops / s; spans 10 s); sub: 0 ​​(0.00 ops / s; spans 10s) Sync timeouts: 0; fire and forget: 0; Last beat: -1s ago

Can anyone decrypt this?

+4
source share
3 answers

I am with the Azure Web Apps team - it looks like your VNET is in a particularly weird state and interrupted the network connection for your application. I fixed this behavior.

We are incredibly sorry for the inconvenience ...

+2
source

Perhaps we have the same problem. I was able to host the test application in a web application in Azure without a virtual network, and it works right out of the box (using Stackexchange.Redis). When I put the same code in a web application that part of the virtual network is down.

I managed to fix the first error ("Could not connect to redis servers ...") by setting the AbortOnConnectFail parameter to false. Then I got the error message "There is no connection to service this operation: EXISTS foo" (= in this case it tries to check if the key "foo" exists).

I can also fix this by setting ConnectTimeout for 10 seconds. Basically, I can make it work, but this seems to cause long delays when (I suppose) SE.Redis loses connection and tries to reconnect.

0
source

If none of the messages helped, you can check:

  • double check your password (private key) for correctness
  • try checking / unchecking the "32-bit" checkbox in the project properties if the application is completed.
  • try disconnecting ssl from the Azure redis side (from ui) and try setting useSsl to false.
  • download the source code (from there: https://github.com/StackExchange/StackExchange.Redis ) and try to debug the internal problem.

Part of this manipulation helped me.

0
source

Source: https://habr.com/ru/post/1215325/


All Articles