R
Railway10mo ago
ThomasZ

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
Percy
Percy10mo ago
Project ID: d0b3dc19-02c9-4290-bf51-904f50b320a7
Brody
Brody10mo ago
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 code
ThomasZ
ThomasZ10mo ago
might be a dumb question, but do i need to blur out the passkey next to default: when sending screenshots?
Brody
Brody10mo ago
you should be using environment variables, your screenshot should not include anything sensitive
ThomasZ
ThomasZ10mo ago
No description
ThomasZ
ThomasZ10mo ago
i'm trying to use redis with bullmq, if that helps
Brody
Brody10mo ago
show me what you have for your service variables please
ThomasZ
ThomasZ10mo ago
No description
Brody
Brody10mo ago
so what is this imaginary RAILWAY_KEY variable? dont know where you got that from, you want to use REDIS_PRIVATE_URL
ThomasZ
ThomasZ10mo ago
that's comin from my .env in my node process, i tried to use REDIS_PRIVATE_URL and that didn't work
Brody
Brody10mo ago
what error did you get when you used the proper REDIS_PRIVATE_URL variable?
ThomasZ
ThomasZ10mo ago
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' }
Brody
Brody10mo ago
please use this to download the logs https://bookmarklets.up.railway.app/log-downloader/
ThomasZ
ThomasZ10mo ago
that work?
Want results from more Discord servers?
Add your server