Unable to connect to redis from background worker

As the title says, I can’t connect to my render-hosted redis from my render-hosted background worker. They are both in the same region.

[21:27:58.069] INFO (52): [Redis] Client Error: Error: getaddrinfo ENOTFOUND red-ck4ffne...

This is the code we’re using to connect:

const redisClient = createClient({
  url: process.env.REDIS_URL,
  socket: {
    family: 6
  }
});

Any tips are much appreciated. Thank you!

Hi Katie,

If you are connecting via the internal Redis URL provided, can you try removing the socket.family config, as this will try and resolve the address via IPv6: https://github.com/redis/node-redis/blob/HEAD/docs/client-configuration.md. I suspect this may be causing the internal address to not resolve correctly.

Best,

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.