添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
道上混的炒粉  ·  Communities·  4 月前    · 
低调的海豚  ·  'java.sql.SQLException ...·  6 月前    · 
粗眉毛的薯片  ·  Data Types Reference ...·  7 月前    · 
含蓄的消炎药  ·  Django Wechat Hello ...·  1 年前    · 

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Description

I'm stucking with this issue in my Production server. When adding a job to queue, sometimes It throws an error "Cannot read property 'id' of undefined", I was using Bull Board to retry several times and it's work. I have double-checked my code and logging, so this exception is not from my code.

TypeError: Cannot read property 'id' of undefined
    at PayrollService.sendSystemEmailWithQueue (/app/dist/modules/payroll/payroll.service.js:60:106)
    at handlers.<computed> (/app/node_modules/bull/lib/queue.js:663:42)
    at Queue.processJob (/app/node_modules/bull/lib/queue.js:1098:22)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

Bull version

I'm using node v12.20.1, @nestjs/bull ^0.4.1, Redis 6.0.5. I have tried both 0.4.1 and 0.3.1, but same issue.

I notice in your screenshot your job function seems to be both using a done callback and returning a promise. I don't know if this is related to your id issue or not, but it should only be doing one or the other - either use a regular function and call done(), or return a promise, but not both.

The backtrace does pretty directly point to your code, as well - are you certain the code you are looking at is the same version that is running?