StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s)

Created on 7 Jul 2016  Âˇ  10Comments  Âˇ  Source: StackExchange/StackExchange.Redis

Hi,

I have installed the Redis server on Linux box with IP xxx.xxx.xxx.123 and the server is running on the port 6379 (Default). I am trying to Create connection using the below code
var configOption = new ConfigurationOptions();
configOption.EndPoints.Add("xxx.xxx.xxx.123:6379");
configOption.AllowAdmin = true;
//configOption.AbortOnConnectFail = false;
var multiplier = ConnectionMultiplexer.Connect(configOption);

but on executing the var multiplier = ConnectionMultiplexer.Connect(configOption); line i get the following exception
StackExchange.Redis.RedisConnectionException: StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. SocketClosed on PING.
at StackExchange.Redis.ConnectionMultiplexer.ConnectImpl(Func`1 multiplexerFactory, TextWriter log) in C:TeamCitybuildAgentwork3ae0647004edff78StackExchange.RedisStackExchangeRedisConnectionMultiplexer.cs: line 876
at StackExchange.Redis.ConnectionMultiplexer.Connect(ConfigurationOptions configuration, TextWriter log) in C:TeamCitybuildAgentwork3ae0647004edff78StackExchange.RedisStackExchangeRedisConnectionMultiplexer.cs: line 854.

Kindly help.

Most helpful comment

I have load redis Docker on Ubuntu, it can access from my pc , but get error on app from same server:
[StackExchange.Redis.RedisConnectionException:StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. SocketFailure on PING at StackExchange.Redis.ConnectionMultiplexer.<ConnectAsync>d__72.MoveNext() in c:\code\StackExchange.Redis\StackExchange.Redis\St ackExchange\Redis\ConnectionMultiplexer.cs:line 799 --- End of stack trace from previous location where exception was thrown ---

All 10 comments

Any chance this is a firewall or routing problem?
On 7 Jul 2016 12:35 pm, "rohitimuraks" [email protected] wrote:

Hi,

I have installed the Redis server on Linux box with IP xxx.xxx.xxx.123 and
the server is running on the port 6379 (Default). I am trying to Create
connection using the below code
var configOption = new ConfigurationOptions();
configOption.EndPoints.Add("xxx.xxx.xxx.123:6379");
configOption.AllowAdmin = true;
//configOption.AbortOnConnectFail = false;
var multiplier = ConnectionMultiplexer.Connect(configOption);

but on executing the var multiplier =
ConnectionMultiplexer.Connect(configOption); line i get the following
exception
StackExchange.Redis.RedisConnectionException:
StackExchange.Redis.RedisConnectionException: It was not possible to
connect to the redis server(s); to create a disconnected multiplexer,
disable AbortOnConnectFail. SocketClosed on PING.
at
StackExchange.Redis.ConnectionMultiplexer.ConnectImpl(Func`1 multiplexerFactory, TextWriter log)
in
C:TeamCitybuildAgentwork3ae0647004edff78StackExchange.RedisStackExchangeRedisConnectionMultiplexer.cs:
line 876
at
StackExchange.Redis.ConnectionMultiplexer.Connect(ConfigurationOptions configuration, TextWriter log)
in
C:TeamCitybuildAgentwork3ae0647004edff78StackExchange.RedisStackExchangeRedisConnectionMultiplexer.cs:
line 854.

Kindly help.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/StackExchange/StackExchange.Redis/issues/442, or mute
the thread
https://github.com/notifications/unsubscribe/AABDsCFLs0K0eW8Ui4BSxkNwynej9goBks5qTORrgaJpZM4JG_Zk
.

I have disabled the firewall
On Jul 7, 2016 5:41 PM, "Marc Gravell" [email protected] wrote:

Any chance this is a firewall or routing problem?
On 7 Jul 2016 12:35 pm, "rohitimuraks" [email protected] wrote:

Hi,

I have installed the Redis server on Linux box with IP xxx.xxx.xxx.123
and
the server is running on the port 6379 (Default). I am trying to Create
connection using the below code
var configOption = new ConfigurationOptions();
configOption.EndPoints.Add("xxx.xxx.xxx.123:6379");
configOption.AllowAdmin = true;
//configOption.AbortOnConnectFail = false;
var multiplier = ConnectionMultiplexer.Connect(configOption);

but on executing the var multiplier =
ConnectionMultiplexer.Connect(configOption); line i get the following
exception
StackExchange.Redis.RedisConnectionException:
StackExchange.Redis.RedisConnectionException: It was not possible to
connect to the redis server(s); to create a disconnected multiplexer,
disable AbortOnConnectFail. SocketClosed on PING.
at
StackExchange.Redis.ConnectionMultiplexer.ConnectImpl(Func`1
multiplexerFactory, TextWriter log)
in

C:TeamCitybuildAgentwork3ae0647004edff78StackExchange.RedisStackExchangeRedisConnectionMultiplexer.cs:
line 876
at
StackExchange.Redis.ConnectionMultiplexer.Connect(ConfigurationOptions
configuration, TextWriter log)
in

C:TeamCitybuildAgentwork3ae0647004edff78StackExchange.RedisStackExchangeRedisConnectionMultiplexer.cs:
line 854.

Kindly help.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/StackExchange/StackExchange.Redis/issues/442, or
mute
the thread
<
https://github.com/notifications/unsubscribe/AABDsCFLs0K0eW8Ui4BSxkNwynej9goBks5qTORrgaJpZM4JG_Zk

.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/StackExchange/StackExchange.Redis/issues/442#issuecomment-231059970,
or mute the thread
https://github.com/notifications/unsubscribe/ATZUK7kMZYycsSZYdS_VjhxROBevBbQeks5qTOzvgaJpZM4JG_Zk
.

Issue has been fixed I was missing on the configuration changes for bind in Redis.conf

Hi, I am getting the same issue after several successful connections, can you please tell me how did you resolve this issue?

An exception of type 'StackExchange.Redis.RedisConnectionException' occurred in StackExchange.Redis.dll but was not handled in user code

Additional information: It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. SocketClosed on PING

Hi,

The issue with me was that I was trying to Remotely connect to Redis server.
My Solution: There is a configuration in Redis.config which says Bind IP. By default it is local server IP on which Redis server is running. This is a security feature provided by Redis. So if you are trying to access the Redis server from a client which is on some other machine then you need to inform Redis that this client is a trusted client and hence allow access. To do this you have to add the Client's IP in the Bind section of Redis.Conf file available in Redis installation path.

You can also try RedisDesktopManager or redis-cli to connect from wherever this code is being ran to determine if this is an issue with SE.Redis or your server

I have this with Mono on Linux (Ubuntu), trying to connect to both localhost or 127.0.0.1:6379 fails with this exception but RedisDesktopManager works fine.

I have load redis Docker on Ubuntu, it can access from my pc , but get error on app from same server:
[StackExchange.Redis.RedisConnectionException:StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. SocketFailure on PING at StackExchange.Redis.ConnectionMultiplexer.<ConnectAsync>d__72.MoveNext() in c:\code\StackExchange.Redis\StackExchange.Redis\St ackExchange\Redis\ConnectionMultiplexer.cs:line 799 --- End of stack trace from previous location where exception was thrown ---

Has a same problem @ mono.
Solution:

  1. Download and unpack StackExchange.Redis library from there: https://www.nuget.org/packages/StackExchange.Redis.Mono/
  2. Replace appropriate assemblies

Or use nuget manager (if possible) to replace packages to mono related.

@rostislav-nikitin, Thank you very much!
The problem was in mono!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tombatron picture tombatron  Âˇ  4Comments

tonycoelho picture tonycoelho  Âˇ  3Comments

wreckedpc picture wreckedpc  Âˇ  3Comments

anytime-hxy picture anytime-hxy  Âˇ  4Comments

deepaknc picture deepaknc  Âˇ  5Comments