2

I have a socket.io node script running that acts as a chat server. I had it running on a local server ok, and have since tried moving it over to openshift.

I used the following cartridge to get it working - https://github.com/smarterclayton/openshift-redis-cart/issues

While running the local version of the server, while connecting to the openshift redis, I get strange timeouts exactly 127 seconds after I run the script.

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: Redis connection to <server> failed - connect ETIMEDOUT
    at RedisClient.on_error (/path/node_modules/redis/index.js:196:24)
    at Socket.<anonymous> (/path/node_modules/redis/index.js:106:14)
    at Socket.emit (events.js:95:17)
    at net.js:441:14
    at process._tickCallback (node.js:442:13)

I have seen the events.js:72 one before, but its usually when I try to run a node script with something already running on that port.

Pretty sure the script itself is fine, as when I swap out the redis server for my local one, it will sit there for days and work fine.

So my question: why is my socket.io script killing itself after exactly 127 seconds when redis is hosted on openshift?

Horse
  • 3,023
  • 5
  • 38
  • 65
  • 1
    Are you using the rhc port-forward command so that you can connect to redis on OpenShift? Otherwise that port is not publicly available. –  May 11 '15 at 15:06
  • I was using that, however I was being an idiot! I had it running in the wrong terminal (had about 20 open), so was running from a remote server instead. Although strangely before those 127 seconds the script was working ok, I guess it just must not have been reporting back the Redis timeout for 127 seconds. Want to post that as the answer so I can accept? :) – Horse May 11 '15 at 16:30

1 Answers1

1

Are you using the rhc port-forward command so that you can connect to redis on OpenShift? Otherwise that port is not publicly available.