We can’t connect from our Render Cron Jobs to our Render Redis instance
We’re using the same region, and same code works on AWS (but not on render)
Dec 26 06:40:16 PM [ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
Dec 26 06:40:16 PM at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1471:16)
This issue was raised before but was marked as an application issue (incorrectly imo)
I have pasted in the internal redis URL into my app’s env configuration under REDIS_URL as the docs mention.
When the app starts in Render, I am getting the following error and then the app refuses to start:
Jul 18 04:45:31 PM Error: Redis connection to red-c9erv7gnlki5356k75v0:6379 failed - getaddrinfo ENOTFOUND red-c9erv7gnlki5356k75v0
Jul 18 04:45:31 PM at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:60:26) {
Jul 18 04:45:31 PM errno: 'ENOTFOUND',
Jul 18 04:45:31 PM code:…
Hi there,
Thanks for reaching out.
The error shared above shows the Redis client is trying to connect to 127.0.0.1, Redis will be running on its own instance and not localhost.
You’ll need to ensure your app is configured to use the connection string provided by the Redis service, more on this here: Connecting to Your Redis From Services on Render
Kind regards
Hey Ali,
From your log output there,
127.0.0.1:6379
would be a Redis running on the same instance as the code is, which probably isn’t what you want to be happening here so is very much an application issue, if you’re using a Render Redis then you need to make sure you’re using the Redis internal connection string from the Cron job to connect to the Redis
John B