2

I have a nestjs project which runs scheduled tasks, but when I try to run it on Ubuntu 22.04, it throws an error when starting the application. This is the error Error: Unknown alias: fal. Stacktrace below

Error: Unknown alias: fal at /home/ashan/Source/holistic-theory/node_modules/cron/lib/time.js:403:11 at String.replace () at CT._parse (/home/ashan/Source/holistic-theory/node_modules/cron/lib/time.js:398:20) at new CT (/home/ashan/Source/holistic-theory/node_modules/cron/lib/time.js:96:9) at new CJ (/home/ashan/Source/holistic-theory/node_modules/cron/lib/job.js:62:19) at /home/ashan/Source/holistic-theory/node_modules/@nestjs/schedule/dist/scheduler.orchestrator.js:56:29 at Array.forEach () at SchedulerOrchestrator.mountCron (/home/ashan/Source/holistic-theory/node_modules/@nestjs/schedule/dist/scheduler.orchestrator.js:54:18) at SchedulerOrchestrator.onApplicationBootstrap (/home/ashan/Source/holistic-theory/node_modules/@nestjs/schedule/dist/scheduler.orchestrator.js:27:14)

AshanPerera
  • 596
  • 1
  • 7
  • 18
  • What do your cron expressions look like? Do they contain localized aliases? https://github.com/kelektiv/node-cron/issues/296 – skink Sep 09 '22 at 09:05
  • 1
    I need this to run everyday at 10am, so I use this `0 10 * * *` – AshanPerera Sep 13 '22 at 18:36
  • 1
    I guess `false` is being passed to `node-cron` somehow (and logged as `fal`). I don't have a Ubuntu machine at hand but you could try to debug it by placing a breakpoint in `node_modules/@nestjs/schedule/dist/scheduler.orchestrator.js:54:18)` and inspecting why `options.cronTime` is getting parsed as `false`. – skink Sep 14 '22 at 17:55
  • my bad, seems I had mixed up the config and a false was passed instead of the cron expression – AshanPerera Sep 20 '22 at 05:02

1 Answers1

0

The error was because instead of a cron expressions like * 10 * * *, the value false was being passed as an input

AshanPerera
  • 596
  • 1
  • 7
  • 18