I have a project using NestJS version 9.2.0 with Bull Queue version 4.9.0 which is connecting to Redis to schedule jobs.
Locally this is working as expected, however, when deploying to staging then Bull won't connect and it fails with error maxRetriesPerRequest
.
My assumption is that on staging Bull is not being able to connect over TLS connection, however I am unable to confirm that this is definitely the issue.
I have tried the following without having any success:
- set the Redis url as
rediss://.....
- pass the parameter
?tls=true
at the end of the Redis url - pass an empty
tls: {}
object as part of the Redis configuration which I then use within theBullModule
that I am importing as use as factory within theapp.module
file
The reasons why I suspect it is an issue related to TLS connection:
- the local connection works just fine
- when I set an invalid URL locally mocking a scenario where Bull cannot connect to Redis I experience the same behaviour in the console as it happens on staging and production
- I ensured that the Redis instance on staging and production is up and running and that the url I am using in the app is correct