cancel
Showing results for 
Search instead for 
Did you mean: 

Many duplicate pending cron jobs in cron_schedule table

Many duplicate pending cron jobs in cron_schedule table

I'm using Magento 2.3.3 (this issue was reported as fixed in Magento 2.2)

I'm seeing many duplicated scheduled cron jobs in the cron_schedule database table.

Recently I had to TRUNCATE the table because it was huge and slowing the website down.

I can see this building up again over time.

Anyone know why the pending jobs are duplicating and how to stop this table bloating please?

Many Thanks in Advance

Andy

 

6 REPLIES 6

Re: Many duplicate pending cron jobs in cron_schedule table

Hi @Andy_Acute ,

I found one solution on one of the forum response. Please try the same.

 

I was also confused with this issue where magento is creatin multiple entries for same jobcode and I am able to fix it.

I have created the job schedule for 15 min on server 
https://prnt.sc/p57rci

and made these setting in admin
https://prnt.sc/p57rml

 

After making this setting I get all records success without any pending or missed.
https://prnt.sc/p57qm3

 

You can write custom script in php file to delete entries from cron_schedule table which are completed.

 

Hope this helps you!

Problem Solved! Click Kudos & Accept as Solution!

Re: Many duplicate pending cron jobs in cron_schedule table

Hi Nishu

 

Thank you for your response.

having dug a little deeper, I can see that some of my third party extension crons are not being added to the schedule at all. This is in addition to the duplicate jobs being added.

I'm going to post a new question regarding the whole cron process as there seems a lot of confusion on how the configuration works.

Thanks again for replying

Andy

Re: Many duplicate pending cron jobs in cron_schedule table

I have the exact same issue, did you find out any solution yet? Thank you.

Re: Many duplicate pending cron jobs in cron_schedule table

You will need to register the `bin/magento cron:run` in your system cron job. Magento will not automatically run this command nor the job registered in the cron_scheduled table. I have the same issue the I can see there are contents in job_scheduled table but not get executed, the status remains pending.

Re: Many duplicate pending cron jobs in cron_schedule table

@Nishu Jindal none of your linked images are working - do you have the link to where you found the solution?

 

thanks 

Re: Many duplicate pending cron jobs in cron_schedule table

Looks like this issue might be linked to a cron job misconfiguration or a failure to properly clear the table. You could try reviewing your cron setup and double big mac with bacon ensure jobs are being properly marked as complete. Adding a cleanup script might help prevent further bloat.