{"record":{"id":"44311465910e1622","repo":"immich-app/immich","slug":"invalid-worker-s-found-workers-join","errorCode":null,"errorMessage":"Invalid worker(s) found: ${workers.join(',')}","messagePattern":"Invalid worker\\(s\\) found: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"server/src/repositories/config.repository.ts","lineNumber":190,"sourceCode":"\nconst getEnv = (): EnvData => {\n  const parseResult = EnvSchema.safeParse(process.env);\n  if (!parseResult.success) {\n    const messages = ['Invalid environment variables: '];\n    for (const issue of parseResult.error.issues) {\n      const path = issue.path.join('.');\n      messages.push(`  - [${path}] ${issue.message}`);\n    }\n    throw new Error(messages.join('\\n'));\n  }\n  const dto = parseResult.data;\n\n  const includedWorkers = asSet(dto.IMMICH_WORKERS_INCLUDE, [ImmichWorker.Api, ImmichWorker.Microservices]);\n  const excludedWorkers = asSet(dto.IMMICH_WORKERS_EXCLUDE, []);\n  const workers = [...setDifference(includedWorkers, excludedWorkers)];\n  for (const worker of workers) {\n    if (!WORKER_TYPES.has(worker)) {\n      throw new Error(`Invalid worker(s) found: ${workers.join(',')}`);\n    }\n  }\n\n  const environment = dto.IMMICH_ENV || ImmichEnvironment.Production;\n  const isProd = environment === ImmichEnvironment.Production;\n  const buildFolder = dto.IMMICH_BUILD_DATA || '/build';\n  const folders = {\n    geodata: join(buildFolder, 'geodata'),\n    web: join(buildFolder, 'www'),\n  };\n\n  let redisConfig = {\n    host: dto.REDIS_HOSTNAME || 'redis',\n    port: dto.REDIS_PORT || 6379,\n    db: dto.REDIS_DBINDEX || 0,\n    username: dto.REDIS_USERNAME || undefined,\n    password: dto.REDIS_PASSWORD || undefined,\n    path: dto.REDIS_SOCKET || undefined,","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/immich-app/immich/blob/199723261c6ffa897fec8ccdaea6359e39c37cc3/server/src/repositories/config.repository.ts#L172-L208","documentation":"After env validation, getEnv() computes the effective worker set from IMMICH_WORKERS_INCLUDE minus IMMICH_WORKERS_EXCLUDE and checks each against WORKER_TYPES. Any unknown value throws Error('Invalid worker(s) found: <list>'). This guards against misconfigured worker selection at startup.","triggerScenarios":"Setting IMMICH_WORKERS_INCLUDE or IMMICH_WORKERS_EXCLUDE to a comma-separated list containing a worker name that is not a valid ImmichWorker enum value.","commonSituations":"Typo in a worker name (e.g. microservices vs microservice); referencing a worker removed/renamed in a newer version; copy-pasting a stale list from old docs.","solutions":["Compare the listed workers to the current ImmichWorker enum and correct any typo/renamed value.","Remove unknown entries from IMMICH_WORKERS_INCLUDE/EXCLUDE.","Leave both vars unset to use the defaults (api + microservices)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { ImmichWorker } from '@immich/sdk';\nconst VALID = new Set(Object.values(ImmichWorker));\nconst requested = (process.env.IMMICH_WORKERS_INCLUDE ?? '').split(',').filter(Boolean);\nconst bad = requested.filter((w) => !VALID.has(w as ImmichWorker));\nif (bad.length) throw new Error(`Unknown workers: ${bad.join(', ')}`);","typeGuard":"const isWorker = (v: string): v is ImmichWorker =>\n  new Set(Object.values(ImmichWorker)).has(v as ImmichWorker);","tryCatchPattern":null,"preventionTips":["Reference the current ImmichWorker enum when setting worker env vars.","Avoid pinning worker lists unless you need a split-role deploy; rely on defaults.","Re-validate worker env after version upgrades."],"tags":["configuration","environment","workers","startup","validation"],"backgroundTag":null,"analyzedSha":"199723261c6ffa897fec8ccdaea6359e39c37cc3","analyzedAt":"2026-08-12T04:54:27.085Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}