[Solved] Drupal9 - Attempting to re-run cron while it is already running

Submitted by sysop on Sun, 08/20/2023 - 16:35

Drupal9 - Attempting to re-run cron while it is already running


Attempting to re-run cron while it is already running problem arises when a cron job is possibly interrupted during the execution, possibly due to a server restart. To address this, consider resetting the semaphore and removing the "last run" timestamp from the database. This could help resolve the issue and allow the cron job to function correctly again.

Basically the term 'Cron' refers to the automated tasks that your site runs periodically. It takes care of, for example, checking whether or not updates are available for Drupal core, and for your contributed modules, and themes.

By default 'Cron' runs every three hours, which can be changed to every hour, every 6-hours (or more). You can run cron anytime you like from the top of the "Reports" > "Status report" page. Contributed modules are available for additional cron functions.

Here are the few ways to fix the "Attempting to re-run cron while it is already running" issue:

Step1: Open the terminal and execute the below drush command:

drush sqlq "DELETE FROM semaphore WHERE name = 'cron';"

Step2: Open phpMyadmin/MySQL terminal & select the database. Then execute the below query:

DELETE FROM semaphore WHERE name='cron';


Now, re-run the cron that should work!!!

Related Links:

Drupal7 Cron issues.
Drupal10 Cron issues.