connecting to redis over the private network
Project ID: d0b3dc19-02c9-4290-bf51-904f50b320a7
Hey y'all, having trouble connecting my nodejs app using IORedis to railway's redis instance.
Getting this error message:
Error: connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 6379
}
My connection string is formatted like so:
connection = new IORedis('redis://default:password@name.railway.internal:6379?family=6');
Any help?
102 Replies
Project ID:
d0b3dc19-02c9-4290-bf51-904f50b320a7
Error: connect ECONNREFUSED 127.0.0.1:6379
127.0.0.1:6379
is the default host:port ioredis will use.
please show screenshots of codemight be a dumb question, but do i need to blur out the passkey next to default: when sending screenshots?
you should be using environment variables, your screenshot should not include anything sensitive
![No description](https://cdn.answeroverflow.com/1176344756800995338/screenshot.png)
i'm trying to use redis with bullmq, if that helps
show me what you have for your service variables please
![No description](https://cdn.answeroverflow.com/1176345350668288011/service.png)
so what is this imaginary
RAILWAY_KEY
variable?
dont know where you got that from, you want to use REDIS_PRIVATE_URL
that's comin from my .env in my node process, i tried to use REDIS_PRIVATE_URL and that didn't work
what error did you get when you used the proper
REDIS_PRIVATE_URL
variable?give me a sec, gonna redeploy real quick
Error: getaddrinfo ENOTFOUND redis.railway.internal
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:108:26) {
errno: -3007,
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'redis.railway.internal'
}
please use this to download the logs https://bookmarklets.up.railway.app/log-downloader/
that work?