Redis Refusing Connection to backend

kbanta11TRIAL

a year ago

I have a redis instance in this project and am trying to connect via the REDISPRIVATEURL from a nodejs backend to this redis (backend in this project as well), but it is continually refused with the following error:
Error: connect ECONNREFUSED ::1:6379

at TCPConnectWrap.afterConnect as oncomplete

Emitted 'error' event on Commander instance at:

at RedisSocket. (/app/node_modules/@redis/client/dist/lib/client/index.js:412:14)

at RedisSocket.emit (node:events:517:28)

at RedisSocket.RedisSocketconnect (/app/node_modules/@redis/client/dist/lib/client/socket.js:166:18)

at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

at async Commander.connect (/app/node_modules/@redis/client/dist/lib/client/index.js:185:9)

at async file:///app/server.js:8:1 {

errno: -111,

code: 'ECONNREFUSED',

syscall: 'connect',

address: '::1',

port: 6379

}

View Deploy details

> ⓘ Deployment information is only viewable by Project members and Railway admins.

2 Replies

a year ago

ECONNREFUSED ::1:6379 means you would be using the environment variable incorrectly, please make sure you are using the correct environment variable and using thr redis client correctly.


emmy-nguyenTRIAL

10 months ago

Hi,

I had the same issue although I used the correct environment variables by adding variable reference from redis.


Redis Refusing Connection to backend - Railway Help Station