Closed zjevik closed 3 years ago
I came here to report the same exact problem, only to discover @zjevik already opened an issue.
After (re-)starting the cron, it seems to last exactly an hour when this error is raised again. After that, cron jobs are no longer run and the cron needs restarting manually.
I was not able to debug it, but I did notice that:
I'm not sure if my observation above means anything as I'm not sure if catalogrule_apply_all is the cause of this error for me (as I don't have it in my schedule).
Luca
Following on @jaxtheking I tried to run this module on a clean 2.4.1 installation and the errors go in and out quite randomly. The Cron will stop working for 20 minutes, then works for some time and then doesn't work, etc.
The behaviour is quite strange but one shouldn't install this module in the current version on 2.4.1
Hi @zjevik, I think I managed to keep the crons going by basically reverting commit https://github.com/magemojo/m2-ce-cron/pull/111/commits/b61a48113d64810596cb782852f5ca303f511fb9.
I traced the problem to the service loop, where the code checks for running jobs (determined by the presence of a file in var/cron e.g. cron.4385). However, when the schedule id is passed to getJob, that function throws an error if - or should I say when - said schedule id does not exist within the pendingjobs array.
Therefore, try replacing the getJob function in vendor/magemojo/m2-ce-cron/Model/Schedule.php with the following to see if the cron jobs keep running:
/**
* Set a job by schedule id
*
* @return array
*/
function getJob($scheduleid) {
if (in_array($scheduleid, $this->pendingjobs)) {
return $this->pendingjobs[$scheduleid];
}
return NULL;
}
I'd be curious to see if it works for you too...
@jaxtheking I figure out my issue with the default cron runner and I no longer need to use this module. See https://github.com/magento/magento2/issues/31752
This is no longer my priority and won't be probably using this module in the future. I have 1M+ products and any debugging is very time consuming.
I will try to make the change in my development system in the future but it might take some time.
I can confirm that reverting commit https://github.com/magemojo/m2-ce-cron/commit/b61a48113d64810596cb782852f5ca303f511fb9 solved the issue for me and that the cron jobs have now been running for the last 10 days without stopping.
Could I ask for your input @gnuzealot? Can you see why the changes in that commit would cause the problems described in this issue and evaluate if it's the case to revert it?
Thanks, Luca
This should be resolved with https://github.com/magemojo/m2-ce-cron/pull/114
Hi,
I seem to have an issue that no CRON jobs are run when
catalogrule_apply_all
is running.I have the following error from cron:
And the appropiate error in system.log:
any help to debug this is appreciated