I've found three cron entry points broken by this module:

1) /admin/reports/status/run-cron (as linked to from /admin/reports/status/) logs me out, resulting in an access denied message when the page loads after the request.

2) The Drush command "cron" results in an "unrecoverable error".

3) The Devel module cron path /devel/run-cron (as linked to from the Development block) results in a WSoD.

CommentFileSizeAuthor
#11 1217252-elysia_and_drush.patch6.38 KBwiifm

Comments

jdleonard’s picture

Title: Running cron from link on status report page logs me out » Multiple cron entry points broken
geerlingguy’s picture

Same here. I get logged out when I click on the run cron link...

rich.3po’s picture

Priority: Normal » Major

Also getting the same problem.

Running from drush command crashes drush, and running from the admin panel causes you to be logged out (which i believe is as a result of cron crashing)

I'm using the cron script method for configuring my cron hooks, if that helps

(bumping up priority as this seems pretty critical...)

Cheers

gotheric’s picture

Status: Active » Needs review

I've commited a new (D7) version that should fix the problem.

Let me know if this works, and let me know if drush now is OK (i've tested only running from admin panel).

geerlingguy’s picture

I will test things out in the next few days; the -dev release with your latest commit won't show up until this evening, and I typically don't pull straight from git :(

rich.3po’s picture

Status: Needs review » Needs work

Thanks for the update

It appears that running cron from the admin panel (/admin/reports/status/run-cron) is now working. However, running 'drush cron' still bombs out, unfortunately with a non-helpful error message.

As an additional note (this may belong in a new ticket), after cron is run the 'last run' timestamp does not appear to be updated. This is viewable on the status page here: /admin/reports/status, and makes it hard to determine whether cron ran successfully or not. Also the watchdog message "cron ran successfully" is not being created, which is useful for similar reasons.

Thanks

gotheric’s picture

The method to run elysia cron from drush in running "drush elysia-cron", not "drush cron".

Have you tried this?

gotheric’s picture

Status: Needs work » Fixed

No response, i consider this bug as closed. Reopen it if it's not

Status: Fixed » Closed (fixed)

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

obrienmd’s picture

Status: Closed (fixed) » Active

I'm still having this issue with Drush (running latest stable from Nov 2011). Unfortunately, Aegir queues force us to hit cron via 'drush core-cron', rather than 'drush elysia-cron', so having the ability to run normal cron as Drush entry point (which should then call elysia) is really important.

wiifm’s picture

Priority: Major » Critical
StatusFileSize
new6.38 KB

Surely a cron helper module that actively breaks existing cron functionality can be considered critical.

Here is the error message the drush produces (not very helpful):

» sudo -u www-data drush cron --debug --verbose
Bootstrap to phase 0. [0.01 sec, 2.79 MB]                            [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.02 sec, 3.01 MB] [bootstrap]
Bootstrap to phase 6. [0.04 sec, 6.7 MB]                                                                                                                         [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.04 sec, 6.7 MB]                                                                                        [bootstrap]
Initialized Drupal 7.12 root directory at /var/www/teamspace.co.nz [0.05 sec, 8.3 MB]                                                                               [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.05 sec, 8.3 MB]                                                                                        [bootstrap]
Initialized Drupal site default at sites/default [0.05 sec, 8.31 MB]                                                                                                [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.05 sec, 8.31 MB]                                                                              [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.05 sec, 8.33 MB]                                                                                   [bootstrap]
Successfully connected to the Drupal database. [0.05 sec, 8.34 MB]                                                                                               [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.06 sec, 9.14 MB]                                                                                       [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_login() [0.32 sec, 39.86 MB]                                                                                     [bootstrap]
Successfully logged into Drupal as Anonymous (uid=0) [0.33 sec, 40.95 MB]                                                                                        [bootstrap]
Found command: core-cron (commandfile=core) [0.33 sec, 40.95 MB]                                                                                                 [bootstrap]
Initializing drush commandfile: user [0.33 sec, 40.96 MB]                                                                                                        [bootstrap]
Drush command terminated abnormally due to an unrecoverable error. [0.41 sec, 41.01 MB]                                                                          [error]

From reading #1140842: Drush command terminated abnormally due to an unrecoverable error. - if you call exit() explicity in your code, drush will fail to work, grepping through the Elysia Cron codebase, there is such a call on line 168 inside hook_cron().

Commenting it out, means that drush will work again

» sudo -u www-data drush cron --debug --verbose
Bootstrap to phase 0. [0.01 sec, 2.79 MB]                            [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.01 sec, 3.01 MB] [bootstrap]
Bootstrap to phase 6. [0.03 sec, 6.7 MB]                                                                                                                         [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.03 sec, 6.7 MB]                                                                                        [bootstrap]
Initialized Drupal 7.12 root directory at /var/www/teamspace.co.nz [0.04 sec, 8.3 MB]                                                                               [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.04 sec, 8.3 MB]                                                                                        [bootstrap]
Initialized Drupal site default at sites/default [0.04 sec, 8.31 MB]                                                                                                [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.05 sec, 8.31 MB]                                                                              [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.05 sec, 8.33 MB]                                                                                   [bootstrap]
Successfully connected to the Drupal database. [0.05 sec, 8.34 MB]                                                                                               [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.05 sec, 9.14 MB]                                                                                       [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_login() [0.33 sec, 39.86 MB]                                                                                     [bootstrap]
Successfully logged into Drupal as Anonymous (uid=0) [0.33 sec, 40.95 MB]                                                                                        [bootstrap]
Found command: core-cron (commandfile=core) [0.33 sec, 40.95 MB]                                                                                                 [bootstrap]
Initializing drush commandfile: user [0.33 sec, 40.96 MB]                                                                                                        [bootstrap]
WD cron: Cron run completed. [7.36 sec, 77.35 MB]                                                                                                                   [notice]
Cron run successfully. [7.36 sec, 77.34 MB]                                                                                                                      [success]
Command dispatch complete [7.36 sec, 77.3 MB]                                                                                                                       [notice]
 Timer                Cum (sec)  Count  Avg (msec) 
 page                 7.315      1      7315.22    
 drupal_http_request  1.038      6      173.055    

Peak memory usage was 77.77 MB [7.36 sec, 77.29 MB]                                                                                                                 [memory]

However by commenting out the exit() call then all other module cron runs will execute as per normal (not desired). So what we really need is a way to allow drush to return success here and still exit().

After a bit more research, it turns out that another cron related module has already experienced this issue and have resolved it in the best way that they can - see #1357154: Drush integration: usage of exit() - [Drush command terminated abnormally due to an unrecoverable error.]

Attached is a patch that ports this functionality across to elysia cron.

In any case, I think it needs to be made clearer that drush cron is not to be run anymore, but rather drush elysia-cron only.

obrienmd’s picture

Status: Active » Reviewed & tested by the community

This works great for me against 7.x-2.x-dev. Would love to get this committed!

Yorgg’s picture

I confirm that point 3) on issue #1 still occurs in version 7.x-2.1
meaning that using devel's run-cron produces a wsod.

obrienmd’s picture

Status: Reviewed & tested by the community » Needs work

With the patch in #11, 'drush core-cron' just ignores Elysia Cron and runs every cron hook on every run. I'd like to have it run on 'drush core-cron' - is there any way to make this happen?

I would be happy to sponsor work to make this happen!

gotheric’s picture

@obrienmd: thank for your proposal of sponsorship. However i'm already working in a totally new drush support (the current one is very poor), i plan to release a new DEV version in a couple of weeks.

If you want a quick support before that time, you can try applying the patch here:
http://drupal.org/node/939592#comment-6155392

In general, for questions about drush support refer to this issue:
http://drupal.org/node/939592

obrienmd’s picture

Thanks!

obrienmd’s picture

Issue summary: View changes

adding detail

kala4ek’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)