Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bull
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 175
    • Issues 175
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OptimalBits
  • bull
  • Issues
  • #2536
Closed
Open
Issue created Feb 02, 2023 by Oreoluwa Bimbo-Salami@oreoluwa-bs

[Question] MaxRetriesPerRequest Error

Description

The maxRetriesPerRequest error only during production, everything works fine on my local setup despite using the redis connection string (Upstash: tls turned off).

Screenshot 2023-02-02 at 11 27 46

I found a solution to turn the maxRetriesPerRequest setting to null but then it just hangs indefinitely.

I would really like to know what i could be doing wrong. Thank you.

Minimal, Working Test code to reproduce the issue.

import Redis from "ioredis";
import Queue from "bull";

const REDIS_URL = process.env.REDIS_URL as string;
const client = new Redis(REDIS_URL, {
  lazyConnect: true,
  enableReadyCheck: false,
  maxRetriesPerRequest: 3,
});
const subscriber = new Redis(REDIS_URL, {
  enableReadyCheck: false,
  maxRetriesPerRequest: null,
});

const redisOptions = {
  // redisOpts here will contain at least a property of
  // connectionName which will identify the queue based on its name
  createClient: function (type: string, redisOpts: any) {
    switch (type) {
      case "client":
        return client;
      case "subscriber":
        return subscriber;
      case "bclient":
        return new Redis(REDIS_URL, {
          ...redisOpts,
          enableReadyCheck: false,
          maxRetriesPerRequest: null,
        });
      default:
        throw new Error("Unexpected connection type: ", type);
    }
  },
};


 const queue = new Queue("queuer",redisOptions);


async function addToQueue(data) {
  const job = await queue.add(data);
  return job;
}


queue.process(async (job) => {
  console.log(job.data)
});

Bull version

^4.10.2

Additional information

Production environment NextJS (custom server -> node runtime): "13.0.0", (Using the src directory)

Server environment Centos 7 Cpanel

Assignee
Assign to
Time tracking