Hey all, I’ve created some Background Jobs and I’m attempting to deploy them for testing in my dev environment at AWS through FlightControl, and I’m getting the following error:
JobsLibNotFoundError: api/src/lib/jobs.{ts,js} not found. Run
yarn rw setup jobsto create this file and configure background jobs. Already did that? You'll need to run
yarn rw devor
yarn rw build before you can start the job workers!
Here’s what the worker-related portion of my FlightControl.json file looks like:
"id": "worker",
"name": "Worker",
"type": "worker",
"buildType": "nixpacks",
"cpu": 0.25,
"memory": 0.5,
"minInstances": 1,
"maxInstances": 1,
"buildCommand": "yarn rw setup jobs",
"startCommand": "yarn rw jobs start",
"envVariables": {
"DATABASE_URL": {
"fromService": {
"id": "db",
"value": "dbConnectionString"
}
}
}
}
I thought the buildCommand might address the error but it does not, I get the same error on subsequent attempts.
I appreciate any help anyone can offer!
Here’s the full error in case it’s helpful:
JobsLibNotFoundError: api/src/lib/jobs.{ts,js} not found. Run `yarn rw setup jobs` to create this file and configure background jobs. Already did that? You'll need to run `yarn rw dev` or `yarn rw build` before you can start the job workers!
8:07:36 AM at loadJobsManager (/app/node_modules/@redwoodjs/jobs/dist/loaders.js:43:11)
8:07:36 AM at main (/app/node_modules/@redwoodjs/jobs/dist/bins/rw-jobs.js:187:59)
8:07:36 AM at Object.<anonymous> (/app/node_modules/@redwoodjs/jobs/dist/bins/rw-jobs.js:240:3)
8:07:36 AM at Module._compile (node:internal/modules/cjs/loader:1358:14)
8:07:36 AM at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
8:07:36 AM at Module.load (node:internal/modules/cjs/loader:1208:32)
8:07:36 AM at Module._load (node:internal/modules/cjs/loader:1024:12)
8:07:36 AM at Module.require (node:internal/modules/cjs/loader:1233:19)
8:07:36 AM at require (node:internal/modules/helpers:179:18)
8:07:36 AM at file:///app/node_modules/@redwoodjs/core/dist/bins/rw-jobs.js:8:1
8:07:37 AM Error: Command failed with exit code 1: yarn rw-jobs start
8:07:37 AM at makeError (/app/node_modules/execa/lib/error.js:60:11)
8:07:37 AM at module.exports.sync (/app/node_modules/execa/index.js:194:17)
8:07:37 AM at module.exports.commandSync (/app/node_modules/execa/index.js:235:15)
8:07:37 AM at handler (/app/node_modules/@redwoodjs/cli/dist/commands/jobsHandler.js:54:24)
8:07:37 AM at Object.handler (/app/node_modules/@redwoodjs/cli/dist/commands/jobs.js:46:10)
8:07:37 AM at async runYargs (/app/node_modules/@redwoodjs/cli/dist/index.js:154:3)
8:07:37 AM at async /app/node_modules/@redwoodjs/cli/dist/index.js:106:7
8:07:37 AM at async main (/app/node_modules/@redwoodjs/cli/dist/index.js:95:3)