question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Without no reason" sometimes cron doesn't start

See original GitHub issue

Hi,

i’v some unexplainded troubles, i’v multiple cron scheduled on my “app boostraper” :

        cron.schedule(
          '0 10 * * *',
          () => {
            try {
              console.log('*START Task*')
            } catch (e) {}
          },
          {
            scheduled: true,
            timezone: 'Europe/Paris',
          })

        cron.schedule(
          '0 11 * * *',
          () => {
            try {
              atask2()
            } catch (e) {}
          },
          {
            scheduled: true,
            timezone: 'Europe/Paris',
          })

      cron.schedule(
        '0 0 * * 1',
        () => {
          try {
            atask3()
          } catch (e) {}
        },
        {
          scheduled: true,
          timezone: 'Europe/Paris',
        })
  

Sometimes the 10 AM cron not starting, any reasons ? (it’s happend “randomly” once a week)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:6
  • Comments:5

github_iconTop GitHub Comments

1reaction
jspark-gigworkscommented, Nov 25, 2021

I met the same issue. I have a program that invokes a function once per hour by node-cron. The cron string is 30 0 * * * *.

I have run it for 6 days, but it did not work at 2021-11-22 21:00:30 KST. This is my log at that time:

...

[2021-11-22T14:00:30.454] [DEBUG] [Agent]( 84) Reading.
[2021-11-22T15:00:30.142] [DEBUG] [Agent]( 84) Reading.
[2021-11-22T16:00:30.720] [DEBUG] [Agent]( 84) Reading.
[2021-11-22T17:00:30.308] [DEBUG] [Agent]( 84) Reading.
[2021-11-22T18:00:30.946] [DEBUG] [Agent]( 84) Reading.
[2021-11-22T19:00:30.624] [DEBUG] [Agent]( 84) Reading.
[2021-11-22T20:00:30.334] [DEBUG] [Agent]( 84) Reading.
[2021-11-22T22:00:30.600] [DEBUG] [Agent]( 84) Reading.
[2021-11-22T23:00:30.188] [DEBUG] [Agent]( 84) Reading.
[2021-11-23T00:00:30.895] [DEBUG] [Agent]( 84) Reading.
[2021-11-23T01:00:30.560] [DEBUG] [Agent]( 84) Reading.
[2021-11-23T02:00:30.191] [DEBUG] [Agent]( 84) Reading.
[2021-11-23T03:00:30.877] [DEBUG] [Agent]( 84) Reading.
[2021-11-23T04:00:30.488] [DEBUG] [Agent]( 84) Reading.

...
0reactions
Facjcommented, May 24, 2022

I have noticed the same. Cron job scheduled every 5 minutes misses a start every day or every two days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Top Reasons Your Cron Job Isn't Running - Airplane.dev
This article walks through the most common reasons why your cron job may not be working as expected: schedule errors, environmental changes, ...
Read more >
Troubleshooting: crontab not running - Linux Hint
The first reason is that your cron daemon might not be working for any reason, resulting in your crontab failing. There also exists...
Read more >
Why is my crontab not working, and how can I troubleshoot it?
The vast majority of "my cron script doesn't work" problems are caused by this restrictive path. If your command is in a different...
Read more >
linux - CronJob not running - Stack Overflow
But the cronjob does not run. I have tried checking if the cronjob is running using pgrep cron and that gives process id...
Read more >
Cron job troubleshooting guide - Cronitor
The common reasons cron jobs fail · System resources have been depleted. The most stable cron job is no match for a disk...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found