immich-app/immich · warning
Unable to set queue concurrency, worker not found
Error message
Unable to set queue concurrency, worker not found: '${queueName}' What it means
setConcurrency looks up the BullMQ Worker instance for the given queue and sets its concurrency. If no worker object exists for that queue name, it logs this warning and returns without changing anything. Concurrency for that queue remains at its default.
Solutions
- Call setConcurrency only after workers are initialized (after startWorkers resolves)
- Run it in the process that actually consumes the queue (the microservices worker, not the API server)
- Verify the QueueName value matches an existing registered queue exactly
- Log/persist desired concurrency config and apply it in worker bootstrap if ordering is the issue
Example fix
// before await app.listen(port); jobRepository.setConcurrency(QueueName.MachineLearning, 2); // after await app.listen(port); await jobRepository.startWorkers(); jobRepository.setConcurrency(QueueName.MachineLearning, 2);
Defensive patterns
Strategy: validation
Validate before calling
function canSetConcurrency(job: JobRepository, q: QueueName): boolean {
return q in (job as any).workers;
}
if (!canSetConcurrency(job, QueueName.MachineLearning)) {
await job.startWorkers(); // initialize workers first
}
job.setConcurrency(QueueName.MachineLearning, 2); Type guard
function workerExists(job: JobRepository, q: QueueName): boolean {
const workers = (job as unknown as { workers: Record<string, unknown> }).workers;
return Boolean(workers?.[q]);
} Prevention
- Call setConcurrency only after startWorkers() completes
- Only tune concurrency in the process consuming the queue (microservices)
- Keep queue names in one enum to avoid typos
- Apply concurrency settings during worker bootstrap, not at request time
When it happens
Trigger: setConcurrency(queueName, concurrency) is called for a QueueName whose worker hasn't been created yet in this.workers — e.g. called before worker initialization or for a queue that this process does not consume.
Common situations: Calling setConcurrency during startup before startWorkers registers workers; calling it on the API server process where workers run in microservices; a queue name typo or a queue removed in a newer version.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Invalid job name
- Job is already running
- No microservices worker is connected. Background jobs will…
- Plugin method call failed
- Skipping unknown job
AI-assisted analysis of immich-app/immich@e55ac299a4 (2026-09-15).
Data as JSON: /api/errors/c45ac9fa9fb916f7.
Report an issue: GitHub.
Appendix: source
Thrown at server/src/repositories/job.repository.ts:150
}
}
this.microservicesPresent = isPresent;
}
async run({ name, data }: JobItem) {
const item = this.handlers[name as JobName];
if (!item) {
this.logger.warn(`Skipping unknown job: "${name}"`);
return JobStatus.Skipped;
}
return item.handler(data);
}
setConcurrency(queueName: QueueName, concurrency: number) {
const worker = this.workers[queueName];
if (!worker) {
this.logger.warn(`Unable to set queue concurrency, worker not found: '${queueName}'`);
return;
}
worker.concurrency = concurrency;
}
async isActive(name: QueueName): Promise<boolean> {
const queue = this.getQueue(name);
const count = await queue.getActiveCount();
return count > 0;
}
async isPaused(name: QueueName): Promise<boolean> {
return this.getQueue(name).isPaused();
}
pause(name: QueueName) {
return this.getQueue(name).pause();View on GitHub (pinned to e55ac299a4)