Skip to main content

Warning emails about "cron has been active for X minutes" - Knowledgebase / Deskpro Legacy - Deskpro Support

WARNING: You're browsing documentation for an older version of Deskpro. Consider upgrading to Deskpro Horizon

Warning emails about "cron has been active for X minutes"

Authors list

About cron.php task scheduling

Scheduled tasks in Deskpro are run every minute using your server's scheduling features (e.g., cron on Linux or Task Scheduler on Windows). Every minute, your server will invoke the Deskpro cron.php command.

It's possible for two commands to run simultaneously. For example, if the task started at 08:00 runs for longer than a minute, the task that starts at 08:01 will start and you will have two tasks running at the same time.

To prevent this, Deskpro keeps an internal status. When cron.php starts, is_running=yes is set. When cron.php ends, is_running=no is set. That way, Despro knows when an existing task is still running so it can prevent a second task from starting when "is_running" is already "yes".

 

What the error means

If you get a notice like this:

WARNING: Cron has been active for 15 minutes. Assuming crashed process, resuming.

It usually means that there was a problem processing your scheduled tasks and cron.php crashed. Since the process exited without completing, it means the special is_running flag discussed above did not get reset. Your server would continue to run cron.php every minute but Deskpro would think a previous task was still running, so it would prevent new tasks from running again.

But after 15 minutes of is_running=yes, Deskpro guesses there was a problem and tasks resume again anyway. You are sent this alert as a warning that something probably went wrong, and you should investigate.

 

If it only happened once...

If the problem only happened once (or very infrequently), you might be able to just ignore it. Possible mundane causes include things like server reboots or temporary MySQL or network errors. The system will recover fine in cases like these.

 

Discovering the cause

Cron tasks should always exit cleanly and when they don't, it means there's a problem we need to investigate.

You can gather further information about the error by following the steps in the article How to debug cron.

Here are some common causes:

  • MySQL errors such as "MySQL gone away" usually mean the database server was restarted or it was temporarily inaccessible (e.g. due to a network problem). For singular cases you can just ignore it. If you continue to get the same error multple times, you need to ask your sysadmin to investigate.
  • Other MySQL errors such as invalid SQL, insert or update errors, etc. are possibly related to software bugs. You should contact Deskpro support for help.
  • Deskpro often logs lots of information for non-critical errors like connection timeouts to your mail servers. These notices are for information purposes but would not cause a problem with cron. So they are not indicative of a problem and are probably unrelated.

If you need help trying to find the cause of a cron error, you can contact Deskpro support. Please contact support@deskpro.com with all of the log files you get from Admin > Server > Error Logs.

 

PHP 5.6

One known cause of intermittent cron.php crashes is running Deskpro on PHP 5.6.

If you have run into this issue and are using PHP 5.6, update Deskpro to the latest build, which should resolve the issue. If it does not, please report the details of your configuration to support@deskpro.com.

You can also revert to PHP 5.5.x to work around this issue.

Koristan Beskoristan

65 od 133 ljudi smatralo je ovu stranicu korisnom

Add a comment

Please log in or register to submit a comment.

Need a password reminder?