1

I've seen a couple of Drupal workarounds for this, but not for Wordpress.

The CiviCRM status is below; note that the last reported cron run was manually executed by me.

All extensions are up-to-date: CKEditor4: Version 5.43.0 Contribution cancel actions: Version 5.43.0 Event Cart: Version 5.43.0 Financial ACLs: Version 5.43.0 Theme: Greenwich: Version 5.43.0 Custom search framework: Version 5.43.0 reCAPTCHA: Version 5.43.0 Sequential credit notes: Version 5.43.0

PHP Up-to-Date This system uses PHP version 7.4.26 which meets or exceeds the recommendation of 7.3.

Cron Not Running Last cron run at November 26th, 2021 2:35 PM.

I have a separate Cron task for each Scheduled Job, specified on cPanel using the CLI method (because this works better than wget, and no other method worked for me). I can see all tasks are running as they should [Administer > System Settings > Scheduled Jobs], yet the "Cron Not Running" message still pops-up constantly too. This is really annoying.

Here's an example of one of my cPanel Cron jobs, working as expected at 1AM daily (0 1 * * *)

/usr/local/bin/ea-php74 /home/ACCOUNT/public_html/wp-content/plugins/civicrm/civicrm/bin/cli.php -s MYDOMAIN -j -u USERNAME -p PASSWORD -e job -a version_check >/dev/null 2>&1

So what triggers this Cron error message? I have set job=version_check to run only once a day, yet it suggests more frequently - "CiviCRM Update Check (Always)". How can you "always" run a periodic job? Is that relevant? Is this just a dumb bug?

1 Answer 1

1

It's hardcoded that it needs to be hourly or more: https://github.com/civicrm/civicrm-core/blob/69cd824e26fc6e90a88e6cf18d9d011c1c85b94e/CRM/Utils/Check/Component/Env.php#L317

And I'm pretty sure it's tracking the Job.execute job, not any individual job: https://github.com/civicrm/civicrm-core/blob/69cd824e26fc6e90a88e6cf18d9d011c1c85b94e/CRM/Core/JobManager.php#L72

5
  • Yes, I get the same thing on any of my sites where we're not running the cron every hour (or more). A lot of ours are set to like every 3 hours or so, so we always have this error come up. I just told it to hide it or whatever so it wouldn't bug me. Dec 6, 2021 at 16:19
  • I increased the frequency of version_check to every hour, but the message still appears. Clearly in my situation, only a manual job execution will satisfy the criteria to make this go away (and then only for an hour). The last thing I want to do is start hacking into core functions when my PHP skills are basic.
    – Garry H
    Dec 7, 2021 at 0:51
  • Is there a reason you need separate cron jobs instead of running job.execute? I.e. just have one cron job with -a execute and enable the jobs at Admin - System Settings - Scheduled Jobs. You could still have individual jobs run separately in addition if you really want.
    – Demerit
    Dec 7, 2021 at 1:13
  • 1
    Aha. I didn't fully understand the baffling cron documentation. So the solution appears to be; 1. at Admin - System Settings - Scheduled Jobs, enable only jobs that don't require parameters (e.g. version_check, cleanup) and let job.execute manage their execution 2. trigger jobs that require parameters separately I didn't realise (until I just tried it) that you can trigger jobs without them being enabled at Admin - System Settings - Scheduled Jobs. That's not mentioned anywhere. Thanks for your help! Problem solved.
    – Garry H
    Dec 7, 2021 at 3:20
  • Yes civi cron can be difficult to get going, especially the first time.
    – Demerit
    Dec 7, 2021 at 3:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.