Currently, Wappler’s NodeJS script doesn’t give enough traceback when an error occurs within a scheduled workflow. Example given:
2022-02-02T03:00:19.050161349Z App listening at http://localhost:80
2022-02-02T04:00:10.320018604Z node:internal/process/promises:246
2022-02-02T04:00:10.320079980Z triggerUncaughtException(err, true /* fromPromise */);
2022-02-02T04:00:10.320088256Z ^
2022-02-02T04:00:10.320094488Z
2022-02-02T04:00:10.320101241Z Error: connect ECONNREFUSED x.x.x.x:3011
2022-02-02T04:00:10.320107693Z at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1161:16)
2022-02-02T04:00:10.320114195Z Emitted 'error' event on Job instance at:
2022-02-02T04:00:10.320120748Z at /usr/src/app/node_modules/node-schedule/lib/Invocation.js:277:17
2022-02-02T04:00:10.320127169Z at processTicksAndRejections (node:internal/process/task_queues:96:5) {
2022-02-02T04:00:10.320133532Z errno: -111,
2022-02-02T04:00:10.320139613Z code: 'ECONNREFUSED',
2022-02-02T04:00:10.320145776Z syscall: 'connect',
2022-02-02T04:00:10.320151756Z address: 'x.x.x.x',
2022-02-02T04:00:10.320162777Z port: 3011
2022-02-02T04:00:10.320174639Z }
The problem with this, I’m unable to see precisely at which step the error occurs. Through these lines I can see the error occurs when called through the task scheduler (cron):
2022-02-02T04:00:10.320114195Z Emitted 'error' event on Job instance at:
2022-02-02T04:00:10.320120748Z at /usr/src/app/node_modules/node-schedule/lib/Invocation.js:277:17
2022-02-02T04:00:10.320127169Z at processTicksAndRejections (node:internal/process/task_queues:96:5) {
But what step exactly? I don’t even know which schedule this error occurs! (fortunately, this is a small app, so I found the problem)
To replicate, just create an API Action calling a random IP address, and then set the built-in scheduler (cron) to execute such Server Action. There’s simply not enough information to aid diagnostics.
It also crashes the server, so this is a bug report