I’ve read through all the forums related to this problem but I can’t find a solution. I have a web application, a worker and a redis instance set up in fly. The webapp is not connecting the the redis instance correctly. Here’s the web app toml. I’m using BullMQ to create the queue and the job is created fine. That seems to work. The error Error: connect ECONNREFUSED 127.0.0.1:6379 is continually logged and the queue cannot listen to onComplete changes.
If you have two separate apps/instances and you are getting this error message: Error: connect ECONNREFUSED 127.0.0.1:6379 – I think the problem is because the app is trying to connect to itself/localhost and not vel-new.internal as you might wish.
How is your app reading the REDIS_URL from the env? It defines redis-xyz.internal but the error references 127.0.0.1; are any of the settings coming through?
I know that BullMQ uses the REDIS_URL environment variable and I think you said that part worked, so I’m wondering if your web app is also using REDIS_URL or not, because the error implies it is not. If it’s a Node.js app, not all the Redis client libraries will default to using the environment variable and you need to pass in process.env.REDIS_URL so it could be that.
According to BullMQ, they just pass the connection options on to ioredis, which “will default to port 6379 and localhost”, see https://docs.bullmq.io/guide/connections.
I ran in to the same issue where it tried to connect to localhost. For me, the issue was that I didn’t pass the connection options to every QueueEvents object. Make sure to set the right connection options on all queues, workers, and queue-events you’re using from BullMQ, since otherwise it will default to localhost.