{"record":{"id":"88e9e8118c0d8325","repo":"thedotmack/claude-mem","slug":"activeserverqueuemanager-requires-claude-mem-queue-engine","errorCode":null,"errorMessage":"ActiveServerQueueManager requires CLAUDE_MEM_QUEUE_ENGINE=bullmq (got ${config.engine}); do not instantiate when bullmq is not selected.","messagePattern":"ActiveServerQueueManager requires CLAUDE_MEM_QUEUE_ENGINE=bullmq \\(got (.+?)\\); do not instantiate when bullmq is not selected\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/server/runtime/ActiveServerQueueManager.ts","lineNumber":40,"sourceCode":"// This boundary intentionally does not start any Worker processors here.\n// Phase 4+ wires processors that consume the queues, calling\n// `start(kind, processor)` once provider generation is ready. Until then,\n// the queues exist as transports for `enqueueOutbox` to publish into.\n\nconst QUEUE_KINDS: ServerGenerationJobKind[] = ['event', 'summary'];\n\nexport class ActiveServerQueueManager implements ServerQueueManager {\n  readonly kind = 'queue-manager' as const;\n\n  private readonly queues: Map<ServerGenerationJobKind, ServerJobQueue<ServerGenerationJobPayload>>;\n  private closed = false;\n\n  constructor(\n    private readonly config: RedisQueueConfig,\n    queues?: Map<ServerGenerationJobKind, ServerJobQueue<ServerGenerationJobPayload>>,\n  ) {\n    if (config.engine !== 'bullmq') {\n      throw new Error(\n        `ActiveServerQueueManager requires CLAUDE_MEM_QUEUE_ENGINE=bullmq (got ${config.engine}); ` +\n          'do not instantiate when bullmq is not selected.',\n      );\n    }\n    this.queues = queues ?? this.buildQueues(config);\n  }\n\n  getQueue(kind: ServerGenerationJobKind): ServerJobQueue<ServerGenerationJobPayload> {\n    const queue = this.queues.get(kind);\n    if (!queue) {\n      throw new Error(`unknown server generation job kind: ${kind}`);\n    }\n    return queue;\n  }\n\n  start(kind: ServerGenerationJobKind, processor: Processor<ServerGenerationJobPayload>): void {\n    this.getQueue(kind).start(processor);\n  }","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d8bc9755e74915e5c3b999181e10a67c889bce2a/src/server/runtime/ActiveServerQueueManager.ts#L22-L58","documentation":"ActiveServerQueueManager only supports the BullMQ queue engine. Its constructor validates config.engine and refuses to instantiate when CLAUDE_MEM_QUEUE_ENGINE is anything other than 'bullmq', since the Redis/BullMQ queue stack cannot run under other engines.","triggerScenarios":"Constructing new ActiveServerQueueManager(config) where config.engine is not 'bullmq' — e.g. the config was built from CLAUDE_MEM_QUEUE_ENGINE=inline or a typo like 'bullMQ'.","commonSituations":"Deploying the server with a queue engine env var left at a non-BullMQ default; refactored code that instantiates the manager unconditionally instead of checking engine first; typos in the engine value.","solutions":["Set CLAUDE_MEM_QUEUE_ENGINE=bullmq in the server environment","Guard construction: only build ActiveServerQueueManager when the resolved config.engine === 'bullmq'","Fix the engine string if it was misspelled (must be exactly 'bullmq')"],"exampleFix":"// before\nconst manager = new ActiveServerQueueManager(config); // throws when engine !== 'bullmq'\n// after\nif (config.engine !== 'bullmq') { throw new Error('server queue requires CLAUDE_MEM_QUEUE_ENGINE=bullmq'); }\nconst manager = new ActiveServerQueueManager(config);","handlingStrategy":"validation","validationCode":"if (config.engine !== 'bullmq') {\n  throw new Error(`server queue stack requires bullmq, got ${config.engine}`);\n}\nconst manager = new ActiveServerQueueManager(config);","typeGuard":"function isBullMqConfig(c: RedisQueueConfig): c is RedisQueueConfig & { engine: 'bullmq' } {\n  return c.engine === 'bullmq';\n}","tryCatchPattern":"try {\n  manager = new ActiveServerQueueManager(config);\n} catch (e) {\n  if (String(e.message).includes('CLAUDE_MEM_QUEUE_ENGINE=bullmq')) {\n    throw new Error('Enable bullmq before using the server queue manager');\n  }\n  throw e;\n}","preventionTips":["Check CLAUDE_MEM_QUEUE_ENGINE in deployment manifests before enabling server queues","Only instantiate the manager behind an engine === 'bullmq' branch","Keep the engine value in one shared config module to avoid typos","Add a startup smoke test that constructs the manager under expected env"],"tags":["config","bullmq","queue"],"backgroundTag":"invalid-config-value","analyzedSha":"d8bc9755e74915e5c3b999181e10a67c889bce2a","analyzedAt":"2026-09-17T16:40:26.182Z","contentChangedAt":"2026-09-17T16:40:26.182Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}