REDIS CONNECTION ERROR
oseikromadmin
HOBBYOP

a year 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

dev
MODERATOR

a year 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


oseikromadmin
HOBBYOP

a year 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


dev
MODERATOR

a year ago

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


oseikromadmin
HOBBYOP

a year ago

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


oseikromadmin
HOBBYOP

a year ago

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

Attachments


brody
EMPLOYEE

a year 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.


skizzinger
PRO

a year ago

Hi,

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

Thanks


brody
EMPLOYEE

a year ago

Please read the docs page fragly linked.


skizzinger
PRO

a year 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.


Loading...