# BullMQ: Error: Missing lock for job 42. moveToFinished / job stalled more than allowable limit

**Code:** `BullMQ: Missing lock for job / job stalled more than allowable limit` · **Category:** Redis · **Seen on:** Redis, Node.js

A BullMQ worker lost the lock on a job (it took too long or the event loop was blocked), so the job is considered stalled.

## Meaning

Long CPU-bound jobs block the Node event loop so lock renewal fails. Fix by using sandboxed processors/worker threads, increasing `lockDuration`, avoiding synchronous heavy work, and ensuring Redis connectivity (`maxRetriesPerRequest: null`, no evictions: `maxmemory-policy noeviction`).

## Common causes

- CPU-bound job blocking the event loop
- `lockDuration` shorter than job step
- Redis latency/disconnects
- Redis `maxmemory-policy` evicting BullMQ keys
- Multiple workers with clock skew

## Quick fix

1. Use sandboxed processors (`new Worker(name, "./processor.js")`)
2. Increase `lockDuration` and `stalledInterval`
3. Set Redis `maxmemory-policy noeviction`

## Detailed fix by platform

### Node.js

1. `new Worker("queue", processor, { connection, lockDuration: 60000 });`

## How to diagnose

1. **Event loop** — Blocked?
2. **Lock** — Duration vs job time?
3. **Redis** — noeviction?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/redis/bullmq-missing-lock-for-job)
