REDIS CONNECTION ERROR

oseikromadminHOBBY

10 months ago

I'm connecting my redis service to another server on another platform but it's not working. I keep getting this

hostname: 'redis.railway.internal'

Aug 5 08:47:14 AM syscall: 'getaddrinfo',

Aug 5 08:47:14 AM code: 'ENOTFOUND',

Aug 5 08:47:14 AM errno: -3008,

Aug 5 08:47:14 AM at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:26) {

Aug 5 08:47:14 AMQueue connection error: Error: getaddrinfo ENOTFOUND redis.railway.internal

Aug 5 08:47:14 AM}

please help. I'm suppose to push the app to production

9 Replies

10 months ago

If you're using ioredis, make sure you're appending ?family=0 to the end of the URL

Read more: https://docs.railway.app/guides/private-networking#known-configuration-requirements-for-ipv6


oseikromadminHOBBY

10 months ago

So I'm using it in my bullmq.
I'm doing something like this
const redisConnection: Record<string, any> = {

host: REDIS_HOST , //This is the redis.railway.internal railway provides

port: Number(REDIS_PORT), // The port

password: REDIS_PASSWORD, // the password

username: REDIS_USER // the username

};

this.queue = new Bull(queueName, {

redis: redisConnection

});
I'm not using ioredis


10 months ago

Try adding a 3 second sleep to your start command (note, not an issue in V2 builder)


oseikromadminHOBBY

10 months ago

Already tried that implementation. I saw it on one of the issues related to redis but it didn't work.


oseikromadminHOBBY

10 months ago

I've even turn the Enable Private networking off but still.

Attachments


10 months ago

  1. You need private networking enabled.

  2. Your databases need to be in the same project as your app that is accessing it.

For context fragly, this a project with only two databases.


skizzingerPRO

8 months ago

Hi,

I'm running into the same problem. Were you able to get it running?

Thanks


8 months ago

Please read the docs page fragly linked.


skizzingerPRO

8 months ago

I read the docs and all help topics about this, otherwise I wouldn't have to write in this forum in the first place.


REDIS CONNECTION ERROR - Railway Help Station