Cron doesn't work in automatic mode. Only in manual. No errors or warning messages. I tried to use the "cron debug" module - also no errors and cron only runs in manual mode.

Can anybody help to understand this problem? Is there any solutions?

Thanks a lot.

Comments

1959mvp’s picture

Same here. On base install of commons, cron does not run as scheduled

TuWebO’s picture

Hi,
Are you calling it explicity from any place?, something like (i.e.)
wget [options] <URL>
Where <URL> should be taken from /admin/config/system/cron

Otherwise it shouldn't run, isn't it?

1959mvp’s picture

Using the cron admin function inside drupal. Setting it for 12 hours, and it never runs. D7 is set to provide cron as part of the installation, accessible at /admin/config/system/cron.

Cron runs successfully on other D7 installations, but not in Commons....

fun.boojum’s picture

Absolutly the same. Nothing to add.

fun.boojum’s picture

Calling site's (drupal commons) CRON with command:
wget <URL>
works fine.

So it is possible to use it with an external cron.

But:

Otherwise it shouldn't run, isn't it?

...it is not so obvious )))

Thank you, TuWebO.

TuWebO’s picture

Hi fun.boojum,
You're right, cron should be executed when using auto running, but looking the code and talking with my workmates, this option is not really good.

How it works AFAIK, is:
- Dupal calls drupal_deliver_html_page
- this calls drupal_page_footer
- that calls system_run_automated_cron <------ HERE WE ARE
- this last one checks for DRUPAL_CRON_DEFAULT_THRESHOLD, wich is the variable we set in the /admin/config/system/cron, 10800 by default (in seconds == 3 hours)

That means that cron will be executed only when someone has done a page request, and that guy will get the cron run before getting the page, no good.

Then, maybe we have a starting point to look at. I will check if cron is performing well in my commons install, maybe it is a bug in commons.

We work with elysia_cron, that has another issue if you don't double check the threshold (in the /admin/config/system/cron) has been set to 0 before enable it (that's why I posted this tweet the other day https://twitter.com/TuWebO/status/481131323625852928).

I misunderstood auto run in drupal, know I think I got it clearly... but who knows.

TuWebO’s picture

Title: Cron auto running problem » variable_set('install_task', 'done') is not being called after finishing installation
Category: Support request » Bug report
FileSize
707 bytes

Catch it!
Looks like the installation never calls to
variable_set('install_task', 'done');

and...
system_run_automated_cron always check this:
variable_get('cron_safe_threshold', DRUPAL_CRON_DEFAULT_THRESHOLD)) > 0 && variable_get('install_task') == 'done'

So, cron will never run.
In my installation, this variable has 'install_task' == commons_admin_permissions

So I think this is a bug in the installation profile, changing the category and title.

Adding a patch for it.

Meanwhile, someone could test this code variable_set('install_task', 'done'); in devel/php for example, and see if it solve the problem (not in production sites of course).

japerry’s picture

So I just found something interesting out on my install.. Can you check to see the contents of the variable 'install_task'?

drush vget install_task
install_task: 'commons_admin_permissions'

Thats why my cron doesn't auto run. I'm checking on some other installs to see if this isn't a fluke.

PS.. muahahahah you beat me to it! good work, I' mtesting now.

fun.boojum’s picture

Hi TuWebO,
That's great!
Thank you very much!

  • japerry committed 91596f1 on 7.x-3.x
    Issue #2239951 by japerry, TuWebO: Cleanup commons install and add...
japerry’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.