Question - Crontab validation error around upgrades

Hello,

I have run into an issue when patching my prod instance, System health gives a health error which prevents patching, the issue is the yearly cron task.

If I go back I can see it ran successfully in September 2022 however it is still marked as red in system health, To clear this I have tried to run the yearly manually however get the following error.

www-data@ip-172-31-28-127:~/html/eramba/app/upgrade$ cd /var/www/html/eramba/app/upgrade && bin/cake cron job yearly 
Exception: Your request to execute a yearly CRON job is invalid, either it has been processed already or it is still being processed
In [/var/www/html/eramba/app/upgrade/plugins/Cron/src/Command/CronJobCommand.php, line 130]

2023-03-03 12:01:25 error: [Cron\Exception\InvalidCronJobException] Your request to execute a yearly CRON job is invalid, either it has been processed already or it is still being processed in /var/www/html/eramba/app/upgrade/plugins/Cron/src/Command/CronJobCommand.php on line 130
Stack Trace:
- /var/www/html/eramba/app/upgrade/vendor/cakephp/cakephp/src/Console/BaseCommand.php:179
- /var/www/html/eramba/app/upgrade/vendor/cakephp/cakephp/src/Console/CommandRunner.php:334
- /var/www/html/eramba/app/upgrade/vendor/cakephp/cakephp/src/Console/CommandRunner.php:172
- /var/www/html/eramba/app/upgrade/bin/cake.php:12

Looking at the CronJobCommand.php there is a skip-validation feature however I’m not sure if this is the right way to clear this error pre-patch.

What is the best way to clear the yearly cron system health error in this case ?

edit:

App Version

3.15.1

DB Schema Version

20220721185933

Yes try to run it like this:

su -s /bin/bash -c "bin/cake cron job yearly --skip-validation" www-data

1 Like

That did it!

Thanks.

1 Like