Can not connect to Redis internally

argonft
HOBBY

2 months ago

Hi my deployment can not connect to redis.railway.internal

[ioredis] Unhandled error event: Error: getaddrinfo ENOTFOUND redis.railway.internal at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26)

Solved$10 Bounty

0 Replies

argonft
HOBBY

2 months ago

a6120288-cfda-4153-8e0a-fe8a02c364ce


2 months ago

Bah da da da dah


2 months ago

ioredis!


2 months ago

Add ?family=0 to the end of the connection string


argonft
HOBBY

2 months ago

Alright let me try thanks


argonft
HOBBY

2 months ago

erm now its trying to connect to 127.0.0.1


argonft
HOBBY

2 months ago

[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379

at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)

2 months ago

Can you share the variable you're using now


argonft
HOBBY

2 months ago

${{Redis.REDIS_URL}}?family=0


argonft
HOBBY

2 months ago

i am not sure if i should set ${{Redis.REDIS_URL}}/?family=0 or ${{Redis.REDIS_URL}}?family=0


2 months ago

What you have is fine


argonft
HOBBY

2 months ago

fixed it with using
const redis = new Redis({ host: process.env.REDISHOST, port: process.env.REDISPORT, user: process.env.REDISUSER, password: process.env.REDISPASSWORD, family: 0 })


argonft
HOBBY

2 months ago

using this in the connection URL did not work for me


2 months ago

weird


2 months ago

those two things should do the same thing


2 months ago

oh well


Status changed to Solved brody about 2 months ago