skip to Main Content

i got error when i queue with bull library in node js, the error is like this :

     Error: read ECONNRESET at TCP.onStreamRead 
    - - errno: -104,
   - - code: 'ECONNRESET',
   - - syscall: 'read'
   - - }

and

 MaxRetriesPerRequestError: Reached the max retries per request limit (which is 20). Refer to "maxRetriesPerRequest" option for details.

this my code :

const imageQueue = new Bull("imageQueue", process.env.REDIS_URL);

2

Answers


  1. Chosen as BEST ANSWER

    error solved successfully by adding tls

    const imageQueue = new Bull("imageQueue", process.env.REDIS_TLS_URL, {
      redis: { tls: { rejectUnauthorized: false } },
    });
    

  2. bull uses ioredis to connect, and allows a third opts parameter in the Queue constructor. According to the source code it looks for a redis property within those opts.

    You might try this to raise the retry limit to 100.

    const opts = {redis:{maxRetriesPerRequest:100}}
    const imageQueue = new Bull("imageQueue", process.env.REDIS_URL, opts);
    

    But, also, you may be using Heroku’s redis service more intensively than they allow for the free tier (if that’s what you use).

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search