Skip to content

fix(batch): batch job worker fails to start in prod v2.26.0 — BullMQ requires redis maxRetriesPerRequest: null #1652

Description

@LucasSantana-Dev

Evidence

First prod boot of v2.26.0 (2026-07-01T23:30Z, first release containing the batch-operation framework #1564):

[2026-07-01T23:30:43.411Z] Failed to start batch job worker
Error: BullMQ: Your redis options maxRetriesPerRequest must be null.
TypeError: Cannot read properties of undefined (reading 'client')

Bot init continues (Bot initialization completed successfully at 23:30:58) — non-fatal, but the batch-operation framework is dead in prod: no BullMQ worker → queued batch jobs never process.

Cause

BullMQ requires the shared ioredis connection to be created with maxRetriesPerRequest: null (BullMQ hard requirement for blocking commands). The bot's redis client factory doesn't set it, so new Worker(...) throws. The follow-on TypeError: Cannot read properties of undefined (reading 'client') suggests the error path also dereferences the failed worker.

Fix sketch

Pass a BullMQ-dedicated connection (or maxRetriesPerRequest: null on the shared options) where the worker/queue is constructed in the batch framework bootstrap; guard the failure path so it can't NPE. Note: staging (PR #1564 was label-deployed) likely has the same silent failure — verify there too.

Regression scope: new in v2.26.0 (feature's first release); reproduces on prod boot every start.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageMaintainer needs to evaluate this issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions