Closed tbhaxor closed 1 year ago
Same problem here. I'm at version 2.1.0. The crash is in this code here:
// hard stop if the current date is after the expected execution
if (Date.now() > timeout) {
throw new Error(
Something went wrong. It took over five seconds to find the next execution time for the cron job.
Please refer to the canonical issue (https://github.com/kelektiv/node-cron/issues/467) and provide the following string if you would like to help debug:
Time Zone: ${zone || '""'} - Cron String: ${this} - UTC offset: ${date.format(
'Z'
)} - current Date: ${luxon.DateTime.local().toString()}`
);
}
Curious, @tbhaxor , if this happens every time for you or intermittently. For me, I'm getting this intermittently when running my unit tests when I ask for a bunch of next dates. I'll keep investigating.
Eric
Running into this issue too. Programmatically starting a cron with 0 */5 * * * *
as interval.
For me it happens randomly so far. Need to catch this anyhow since it's apparently happening when it's already about to throw an exception. However, maybe the fact that this error is happening generating the error message is indicative of another underlying problem.
i have the same issue it seems, and it's pretty random too
file:///storage/emulated/0/app/18d69ebda12db328db91.bundle.js TypeError: n.format is not a function
at l._getNextDateFrom (file:///storage/emulated/0/app/18d69ebda12db328db91.bundle.js:2:258591)
at l.sendAt (file:///storage/emulated/0/app/18d69ebda12db328db91.bundle.js:2:257749)
at n.nextDates (file:///storage/emulated/0/app/18d69ebda12db328db91.bundle.js:2:255002)
at t.startTask (file:///storage/emulated/0/app/18d69ebda12db328db91.bundle.js:2:106681)
at t.addGlobalTasks (file:///storage/emulated/0/app/18d69ebda12db328db91.bundle.js:2:105620)
at new t (file:///storage/emulated/0/app/18d69ebda12db328db91.bundle.js:2:105351)
at t.mounted (file:///storage/emulated/0/app/18d69ebda12db328db91.bundle.js:2:107997)
at s.e.init (file:///storage/emulated/0/app/18d69ebda12db328db91.bundle.js:2:99153)
at Sr.<anonymous> (file:///storage/emulated/0/app/18d69ebda12db328db91.bundle.js:2:207994)
at Array.<anonymous> (file:///storage/emulated/0/app/18d69ebda12db328db91.bundle.js:2:12362),vue-component-5-e,nextTick
I have now moved on to different package https://www.npmjs.com/package/node-cron, it is working fine for me
this is fixed in #630
Will there be a 2.2.1 with this fix?
yeah, working on publishing to NPM. might be a 2.3.0 though since we've changed some heavier stuff as well
@barisusakli wow, my nodebb forum also broken as of 12h ago with this error. i wonder what happened! this code looks strange 🤨 https://github.com/kelektiv/node-cron/blob/03f94ad825009e26f58a63ce6316d811aff76990/lib/time.js#L262-L278
and #630 doesn't solve anything, it's still gonna throw the error ☹️ #408 #467 looks like it's been around for years and nobody knows what's wrong? 😦
@ledlamp #467 is a pretty general error which can have a number of causes. basically any time the CPU lags too much the error can be thrown. this can be due to infinite loops, overloaded systems, etc. honestly we should close that issue and focus on issues that have specific causes. no program is perfect so it's unreasonable to expect that it will absolutely never fail
Description
I am getting the following error in the version v2.0.0
https://github.com/kelektiv/node-cron/blob/master/lib/time.js#L271
Cron expression I am using
Screenshots
Additional information
No response