1

I am trying to access Redis(hosted on docker container) in a window service written in C#.net, I am using StackExchange.Redis SDK to access Redis, Whenever I try to access Redis, I am getting following error

StackExchange.Redis.RedisConnectionException: No connection is available to service this operation: FLUSHDB; UnableToConnect (None, last-recv: 23) on 10.0.5.122:57457/Interactive, Flushed/ReadAsync, last: ECHO, origin: ResetNonConnected, outstanding: 0, last-read: 5s ago, last-write: 5s ago, keep-alive: 60s, state: ConnectedEstablishing, mgr: 10 of 10 available, last-heartbeat: never, global: 5s ago, v: 2.0.601.3402; IOCP: (Busy=0,Free=1000,Min=2,Max=1000), WORKER: (Busy=0,Free=32767,Min=2,Max=32767), Local-CPU: n/a ---> StackExchange.Redis.RedisConnectionException: UnableToConnect (None, last-recv: 23) on 10.0.5.122:57457/Interactive, Flushed/ReadAsync, last: ECHO, origin: ResetNonConnected, outstanding: 0, last-read: 5s ago, last-write: 5s ago, keep-alive: 60s, state: ConnectedEstablishing, mgr: 10 of 10 available, last-heartbeat: never, global: 5s ago, v: 2.0.601.3402\r\n --- End of inner exception stack trace ---\r\n

I am using latest version of StackExchange.Redis, I also tried by downgrading version as suggested in couple of articles but no luck, I am also setting AbortOnConnectFail as false. Redis server is up and working fine, I can do telnet and also can see all keys through a tool(Redis React)

Strange things is that, same code is working fine when using in a website with same Redis server.

Please guide. Thanks

8
  • Does the code work, if the programm is on the same computer as the server? If it does, this is a networking problem. Nov 16, 2019 at 19:46
  • @Christopher Code work, Redis is hosted on different server, Code is working in web application but not in window service, both web application and window service are hosted on same server. Nov 16, 2019 at 19:49
  • Then it is most likely a firewall issue. Propably the service was not given a Firewall exception. Nov 16, 2019 at 19:52
  • @Christopher Firewall on docker machine where Redis is running or where windows service is running? Can you guide what changes needs to be done on firewall? Nov 16, 2019 at 19:55
  • This is a question of Network adminsitration, not programming. And I can not help debug this. Only a Administator of those servers can do it. Nov 16, 2019 at 19:57

1 Answer 1

1

For some reason System.Numerics.Vectors.dll was not present in output folder, I copied this manually and it started working

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.