Getting exception when trying to connect to Redis
Hi,
After update nuget package from 1.1.606 to 1.1.608, I am getting RedisConnectionException - It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. Code, that is throwing exception: ConnectionMultiplexer.Connect($"{server}:{port}"); Updated nuget works fine in Windows, I am getting error only in Linux - Target Framework Mono/.Net 4.5 Any Idea, what is the problem?
Thanks, Peter.
Same results on same setup, works on 1.1.606, not on 1.1.608
I encounterd the same problem. 1.1.608 does not work on Linux Mono/.Net 4.5.1. 1.1.606 works fine!
Ran into the same issue with v1.2 (mono 4.6.1).
TL;DR: I did some digging on this and made a workaround that you can find here: (use at your own risk) https://github.com/PathogenDavid/StackExchange.Redis/commit/e2dcded94f6f26685667f4b82887485270c6692f However, SSL is broken for me still, so if you use SSL you might still be stuck.
I am also having this issue, so I decided to do some digging. I will note that this seems to happen on all of 1.1.603, 1.1.606, and 1.2.0 It happens on Mono 4.6.2 on Windows, Ubuntu 64-bit, and Ubuntu armhf.
I've narrowed the issue down to Socket.BeginConnect completely failing under Mono. So I suspect this is a regression in Mono. If you call Socket.BeginConnect on Mono, your callback will never be called even if the socket is established (as observed on Wireshark. I did not dig into Mono yet.)
This can be observed in this minimal test program: https://gist.github.com/PathogenDavid/8e6b7a2d745feb63f22f2991c98eaaf3 Running under .NET, the program quickly connects and then exits. Under Mono, however, the program waits forever for the callback to be called.
As a quick workaround, I simply modified things to use Socket.Connect instead. https://github.com/PathogenDavid/StackExchange.Redis/commit/e2dcded94f6f26685667f4b82887485270c6692f The ideal solution is probably to get Mono fixed, but one possibility would be implementing our own asynchonous connecting.
Unfortunately, it seems SSL isn't working either. SslStream.AuthenticateAsClient simply never returns to PhysicalConnecttion.Connected.
Hopefully this helps point some people in the right direction!
BTW, @NickCraver Shouldn't this issue have the Mono label?
1.2.3 works fine with Mono 5.0.0 (Centos x86_64t, .Net 4.5.1).
Are we good with 1.2.3 on Mono then? I'm not in a position to test here.
Consolidating into #314 where we're tracking this.