Why am i getting Redis connection errors (deploy logs)?

nhc
PROOP

5 months ago

Hi

I used railway templates to deploy a Redis Store. Then I'm using a nodejs app to connect to it.

I've tried both the public URL and the one in the internal network. Both connect fine and I can send jobs to my redis queue. I'm using BullMq and I can see the queue items going through the system.

Why then do I have these polluting my log files every 30 seconds continually.

Error: connect ECONNREFUSED 127.0.0.1:6379

Jun 02 21:02:18

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

Jun 02 21:02:18

errno: -111,

Jun 02 21:02:18

code: 'ECONNREFUSED',

Jun 02 21:02:18

syscall: 'connect',

Jun 02 21:02:18

address: '127.0.0.1',

Jun 02 21:02:18

port: 6379

Jun 02 21:02:18

}

Jun 02 21:02:18

Error: connect ECONNREFUSED 127.0.0.1:6379

Jun 02 21:02:18

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

Jun 02 21:02:18

errno: -111,

Jun 02 21:02:18

code: 'ECONNREFUSED',

Jun 02 21:02:18

syscall: 'connect',

Jun 02 21:02:18

address: '127.0.0.1',

Jun 02 21:02:18

port: 6379

Jun 02 21:02:18

}

I'm sure these are redis errors no? They are in RED in my deploy logs.

$10 Bounty

5 Replies

5 months ago

Is there anything else that's trying to connect to redis? For example, session/cookie manager?


smolpaw
HOBBY

5 months ago

These are your nodejs errors and yes it's related to redis as it's trying to connect to port 6379 on localhost which doesn't exist.
Somewhere in your application you
1. forgot to specify redis url so it's defaulting to localhost
2. the env is undefined so some libraries default to localhost

You can add some debug logs before your definitions to check if the env is undefined.


smolpaw

These are your nodejs errors and yes it's related to redis as it's trying to connect to port 6379 on localhost which doesn't exist.Somewhere in your application you1. forgot to specify redis url so it's defaulting to localhost2. the env is undefined so some libraries default to localhostYou can add some debug logs before your definitions to check if the env is undefined.

charleslukes
PRO

5 months ago

I have the same error rn only for BullMQ, the env is not undefined

It points to the rail way deployed redis url


charleslukes

I have the same error rn only for BullMQ, the env is not undefinedIt points to the rail way deployed redis url

smolpaw
HOBBY

5 months ago

Would it be possible to let me look at your code ? Perhaps give me a temporary access to your repo so i can reproduce and debug it
With this very little info it's just a guessing game.


sim
FREE

5 months ago

The most likely cause for this would be redis or bullmq misconfiguration

https://station.railway.com/questions/getting-read-econnreset-when-trying-to-c-14637160

https://station.railway.com/questions/railway-redis-ioredis-bull-mq-not-connect-f8b79e9a

If you share more about your set up then we can help


Loading...