{"record":{"id":"c03fdb9d2e44d703","repo":"immich-app/immich","slug":"invalid-job-name-name","errorCode":null,"errorMessage":"Invalid job name: ${name}","messagePattern":"Invalid job name: (.+?)","errorType":"http","errorClass":"BadRequestException","httpStatus":400,"severity":"warning","filePath":"server/src/services/queue.service.ts","lineNumber":249,"sourceCode":"\n      case QueueName.FacialRecognition: {\n        return this.jobRepository.queue({ name: JobName.FacialRecognitionQueueAll, data: { force } });\n      }\n\n      case QueueName.Library: {\n        return this.jobRepository.queue({ name: JobName.LibraryScanQueueAll, data: { force } });\n      }\n\n      case QueueName.BackupDatabase: {\n        return this.jobRepository.queue({ name: JobName.DatabaseBackup, data: { force } });\n      }\n\n      case QueueName.Ocr: {\n        return this.jobRepository.queue({ name: JobName.OcrQueueAll, data: { force } });\n      }\n\n      default: {\n        throw new BadRequestException(`Invalid job name: ${name}`);\n      }\n    }\n  }\n\n  private isConcurrentQueue(name: QueueName): name is ConcurrentQueueName {\n    return ![\n      QueueName.FacialRecognition,\n      QueueName.StorageTemplateMigration,\n      QueueName.DuplicateDetection,\n      QueueName.BackupDatabase,\n    ].includes(name);\n  }\n\n  async handleNightlyJobs() {\n    const config = await this.getConfig({ withCache: false });\n    const jobs: JobItem[] = [];\n\n    if (config.nightlyTasks.databaseCleanup) {","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/immich-app/immich/blob/199723261c6ffa897fec8ccdaea6359e39c37cc3/server/src/services/queue.service.ts#L231-L267","documentation":"Thrown by QueueService.start in the default switch case. The name passed through does not match any of the explicitly handled QueueName values (VideoConversion, StorageTemplateMigration, LibraryScanQueueAll, BackupDatabase, Ocr, etc.). BadRequestException with the offending name interpolated -> HTTP 400.","triggerScenarios":"POST start-queue with a QueueName value that exists in the enum but has no start handler (e.g. BackgroundTask, Migration, Search, Sidecar, Workflow, IntegrityCheck, Editor), or with a non-QueueName string that slipped past the schema.","commonSituations":"Client sends a queue name that is pausable/processable but not startable; enum extended without updating the switch; typo or case mismatch in the queue name.","solutions":["Only call start on queues that have an explicit job to enqueue (see the switch cases).","Validate the name against the startable subset (concurrent queues + the named serial queues) before calling.","If a new QueueName was added, extend the switch in QueueService.start to handle it."],"exampleFix":"// before\ndefault: {\n  throw new BadRequestException(`Invalid job name: ${name}`);\n}\n\n// after (list the accepted values)\ndefault: {\n  throw new BadRequestException(\n    `Invalid job name: ${name}. Startable queues: videoConversion, storageTemplateMigration, library, backupDatabase, ocr, ...`,\n  );\n}","handlingStrategy":"validation","validationCode":"// Validate against the startable set before calling start.\nconst STARTABLE = new Set([\n  'videoConversion','storageTemplateMigration','library',\n  'backupDatabase','ocr','thumbnailGeneration','metadataExtraction',\n  'faceDetection','facialRecognition','smartSearch','duplicateDetection','sidecar',\n]);\nif (!STARTABLE.has(name)) {\n  throw new Error(`Queue ${name} has no start handler`);\n}","typeGuard":"const isStartableQueue = (name: string): boolean => STARTABLE.has(name);","tryCatchPattern":"try {\n  await queueService.handleCommand(auth, name, dto);\n} catch (e) {\n  if (e instanceof BadRequestException && /Invalid job name/i.test(e.message)) {\n    // surface the accepted list to the operator\n  }\n  throw e;\n}","preventionTips":["Keep a client-side allowlist of startable queue names in sync with QueueService.start.","When extending QueueName, update the switch in start() in the same change.","Surface the accepted values in the error message."],"tags":["queue","jobs","validation","nestjs","enum"],"backgroundTag":null,"analyzedSha":"199723261c6ffa897fec8ccdaea6359e39c37cc3","analyzedAt":"2026-08-12T04:54:27.085Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}