#Cannot get BullModule to work in Production

9 messages · Page 1 of 1 (latest)

grizzled jackal
#

Hello all, I have been spinning my wheels trying to get NestJS with BullModule working in Production environment. I am able to get it working locally but as soon as I try to run the code in Production (Have tried Heroku and Digital Ocean) it fails. I initially posted my request for assistance here: https://github.com/nestjs/bull/issues/1950 with code. Following that I made a small project with the needed code to isolate it away and because the main repo is private, and have reproduced the same problem. Here is the link to the public example app https://github.com/centralizer/process I also created a test droplet with an Ubuntu OS producing the same problem if anyone wants to see that, let me know and I can give the ip and password.

This is what happens. In production the application runs fine with no indication of any errors during startup. After I try to hit the endpoint and initialize the process, the consumer immediately calls @OnQueueError listener. The @OnQueueError listener will indefinitely continue to be called. I placed a console.log to illustrate that:

At some point I did see an error but i am not sure when it was thrown.

Additionally I have ran the test app without using docker compose with means Redis is not running and I see the same results. So it seems like nest is not able to connect with Redis.

GitHub

Is there an existing issue for this? I have searched the existing issues Current behavior I am having issues getting BullModule to work in a production env like Heroku and Digital Ocean. I get the ...

GitHub

Contribute to centralizer/process development by creating an account on GitHub.

lucid moon
#

So it seems like nest is not able to connect with Redis
Correct. Is your redis server up and running?

grizzled jackal
#

Yes, i am able to connect to the redis cluster via cli.

#

I tried with a cluster crested on Digital Ocean, and one i crested on Reidis cloud

grizzled jackal
#

I have tried using redis cloud as follows

BullModule.forRoot({
  redis: {
    host: 'redis-12233.c267.us-east-1-4.ec2.cloud.redislabs.com',
    port: 12233
  }
}),
#

I can only get this working locally

#

I have also added user and password credentials and nothing works

grizzled jackal
#

Ok God's gift I found the problem. I removed the port "12233" from the host url, I suppose bull module was concatenating and doubling it up.