Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bull
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 175
    • Issues 175
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OptimalBits
  • bull
  • Issues
  • #1386
Closed
Open
Issue created Jul 15, 2019 by Administrator@rootContributor

Jobs are undefined in the queue

Created by: akirilyuk

Description

Hi, we started noticing errors in our production environment. Unfortunately this is the only piece of information I can share with you:

TypeError: client.isJobInList is not a function at Object.isJobInList (/app/node_modules/bull/lib/scripts.js:11:19) at Job._isInList (/app/node_modules/bull/lib/job.js:511:18) at Job.isActive (/app/node_modules/bull/lib/job.js:350:15) at result.then.state (/app/node_modules/bull/lib/job.js:383:27) at process._tickCallback (internal/process/next_tick.js:68:7)

Also we noticed that some jobs in the queue are becoming an empty object.

Minimal code to reproduce

 const jobs = await queue.getJobs();
      try {
        const jobsWithState = await Promise.all(
          jobs.map(async job => {
            try {
              const jobState = await job.getState();
              return { ...job, jobState };
            } catch (err) {
             // this is thrown al the time, however the jobId is undefined
              warn('bull:getJobMetrics: Could not get Job State', {
                jobId: job.jobId
              });
              return { ...job, jobState: undefined };
            }
          })
        );
      } catch (err) {
       // this is not thrown
        error('bull:getJobMetrics:', {
          errorMessage: err.message,
          errorTrace: err.stack
        });
        return null;
      }

Bull version

3.10.0

Assignee
Assign to
Time tracking