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
  • #2554
Closed
Open
Issue created Feb 12, 2023 by Vaibhav Pathak@vkpdeveloper

Not able to use Seperate Processes with bull

Hey Coders,

I have been using Bull for a while with separate processes for doing data processing and uploads but recently our production started failing all these requests because somehow bull is not able to find the process which actually exists in the project.

After digging into the code for a while I understood that under the hood it's using require to load the process/module. So, I tried loading the code myself with the exact same file path (for your information it's an absolute path). It loaded here perfectly but with Bull, it's failing to load the module and throwing an error.

{ stack: 'Error: Error loading process file /home/vaibhav/Documents/Projects/Ant Mascot/apis/src/workers/category-upload.ts. Cannot set an undefined handler\n' + ' at Queue.setHandler (/home/vaibhav/Documents/Projects/Ant Mascot/apis/node_modules/bull/lib/queue.js:670:11)\n' + ' at Queue.process (/home/vaibhav/Documents/Projects/Ant Mascot/apis/node_modules/bull/lib/queue.js:654:8)\n' + ' at Object.<anonymous> (/home/vaibhav/Documents/Projects/Ant Mascot/apis/src/lib/bull/use-cases/uploadCategories.ts:24:20)\n' + ' at Module._compile (node:internal/modules/cjs/loader:1120:14)\n' + ' at Module.m._compile (/home/vaibhav/Documents/Projects/Ant Mascot/apis/node_modules/ts-node/src/index.ts:1618:23)\n' + ' at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)\n' + ' at Object.require.extensions.<computed> [as .ts] (/home/vaibhav/Documents/Projects/Ant Mascot/apis/node_modules/ts-node/src/index.ts:1621:12)\n' + ' at Module.load (node:internal/modules/cjs/loader:998:32)\n' + ' at Function.Module._load (node:internal/modules/cjs/loader:839:12)\n' + ' at Module.require (node:internal/modules/cjs/loader:1022:19)\n' + ' at require (node:internal/modules/cjs/helpers:102:18)\n' + ' at Object.<anonymous> (/home/vaibhav/Documents/Projects/Ant Mascot/apis/src/lib/bull/index.ts:13:1)\n' + ' at Module._compile (node:internal/modules/cjs/loader:1120:14)\n' + ' at Module.m._compile (/home/vaibhav/Documents/Projects/Ant Mascot/apis/node_modules/ts-node/src/index.ts:1618:23)\n' + ' at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)\n' + ' at Object.require.extensions.<computed> [as .ts] (/home/vaibhav/Documents/Projects/...../apis/node_modules/ts-node/src/index.ts:1621:12)', message: 'Error loading process file ..../workers/category-upload.ts. Cannot set an undefined handler' }

I am using the latest version of bull (4.10.4) with typescript. Just for verifying the issue, I build the project and run, still same problem.

Assignee
Assign to
Time tracking