Drupal 8 cron run failed fix

Posted on 09/10/2019

Every here and then Drupal cron will get stuck due to an issue in code, configuration, timeout of one of the services on the server or simply due to a bug.

To fix this you have to empty the semaphore table in the database, specifically the entry where the name key is set to cron. This row contains information that will keep the cron stuck unless it has been removed so Drupal can regenerate it from scratch.

You can of course login to the database management system such as phpMyAdmin and delete that manually, or if you have Drush installed (which you should), you can just run the following command:

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