Drupal 10, the latest version of the open-source digital experience platform with even more features, is here.It would seem that once you enable Elysia Cron you can no longer use the core-cron (cron) command in Drush. Can we work on getting support for invoking cron through Drush with Elysia Cron enabled?
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | elysia_cron_drush_compatibility-939592-16.patch | 661 bytes | thedavidmeister |
| #11 | 939592-11.patch | 1.9 KB | rjbrown99 |
| #7 | elysia_cron_939592_7_drush.patch | 750 bytes | miro_dietiker |
| #2 | elysia_cron_drush.patch | 736 bytes | seanburlington |











Comments
Comment #1
gotheric CreditAttribution: gotheric commentedI don't know Drush module... if it has a support for pluggable or overwritable commands i think it's possibile to overwrite it's standard "core-cron" command.
As soon as i have a little time to look at it i'll check it out... however i don't have much time right now... so be patient...
Comment #2
seanburlington CreditAttribution: seanburlington commentedHi,
cron doesn't work properly via drush when elysia cron is enabled because it calls exit() in hook_cron() which drush sees as an error - I don't see a way around this.
I have written a simple drush hook that provides an option to run elysia_cron_run() via drush
see attached
Comment #3
gotheric CreditAttribution: gotheric commentedPatch ported in next version
Comment #4
seanburlington CreditAttribution: seanburlington commentedThank You :-)
Comment #6
NicolasH CreditAttribution: NicolasH commentedIs this working for people? The elysia-cron command doesn't come up in the drush command list. Could be a drush version issue?
I'm using drush 4.0-rc3 locally and 3.3 externally. I can only get it to work by creating a elysia_cron.drush.inc file, rather than having the commands in elysia_cron.module. This way is the standard of providing drush support for modules, AFAIK.
Comment #7
miro_dietikerAttached patch provides the feature. Better formatted and also supporting cron key.
Patch applies in elysia_cron module folder.
Comment #8
gotheric CreditAttribution: gotheric commentedSo i should put drush declaration on a separate "elysia_cron.drush.inc"? Ok, i'll do it... :)
Wait for a newer release soon...
@miro_dietiker: thanks for the patch. Instead of setting $_GET['cron_key'] run "elysia_cron_run(TRUE)" instead of "(FALSE)". I'll do that in next committed version.
Comment #9
anavarreSubscribe
Comment #10
rjbrown99 CreditAttribution: rjbrown99 commentedFWIW, the 7.x-1.x-dev 2011-Apr-06 version in the tree has drush support in the core module, but it's not picked up by drush. IE, it's not working and you don't see the hook.
Removing all of the drush-related stuff in the main module file AND applying the patch from #7 does work. So for the patch in #7 to be complete it really needs to also rip out the drush stuff from elysia_cron.module.
Comment #11
rjbrown99 CreditAttribution: rjbrown99 commentedPatch for 7.x-1.x-dev 2011-Apr-06, which is the #7 patch plus the stuff to rip out the conflicting stuff in the elysia_cron.module.
Comment #12
miro_dietikerYes... seems changes have been applied to the wrong file...
Please update the code!
Comment #13
gotheric CreditAttribution: gotheric commentedJust committed a new version with correct Drush support.
Comment #14
miro_dietikerCool thx.
Comment #16
thedavidmeister CreditAttribution: thedavidmeister commentedNice that the drush support was added with the "$ drush elysia-cron" command, but the OP specifically requested being able to still run "$ drush cron" without getting the lovely "Drush command terminated abnormally due to an unrecoverable error." message that really doesn't help much with debugging.. I had no idea that there was an elysia-cron command that I was supposed to be using until I found this thread :(
95% of the work for this has been done already so here's a patch that combines the approach in #1204488: Can't install Elysia Cron via an install profile with what has been done here. It really simply handballs elysia_cron_cron() off to the drush_elysia_cron_run_wrapper() that was developed earlier in this thread if we detect that cron was called through drush.
Comment #17
gotheric CreditAttribution: gotheric commentedThanks for the patch, however i'm already working in drush support right now (i extended it a lot, the current support is very poor...), and i already supported stadard "core-cron" hook.
I plan to release a new DEV version (with several new internal improvements and some features) in a couple of weeks.
Comment #18
thedavidmeister CreditAttribution: thedavidmeister commentedgood to hear. This issue just looked closed to me, I had no idea there was more work going on. Thanks for the response :)
Comment #19
obrienmd CreditAttribution: obrienmd commentedGotheric, any ideas on an ETA for that -dev version? I'd love to load it up and provide feedback!
Comment #20
gotheric CreditAttribution: gotheric commentedI've just committed a new DEV version. Wait for it in download packages.
WARNING:
This has a lot of refactoring in internal APIs and should NOT be used in production sites (or do that at your own risk). I've tested it a little, but it's under construction yet so i don't assure every use case works.
It's only for D7 (i'll sync the D6 version only at the end of the development of the D7 one)
Changes:
- A lot of internal API improvements
- Completely rewritten Drush support, with a lot of features (and several to come). Now "drush cron" (or "drush core-cron") works as expected, and has several options.
See "drush help elysia-cron" for them.
- Better support for Drupal queues
Test it and let me know what you think about it (and submit bugs you find, obviously).
Comment #21
obrienmd CreditAttribution: obrienmd commentedGreat! I'll test by end of week at worst.
Comment #22
obrienmd CreditAttribution: obrienmd commentedAfter updating to latest -dev, 'drush cron' and 'drush core-cron' both come back with:
Does this require drush 5?
Of note, elysia seemed to run all cronjobs just fine... It just gave that error at the end of the run.
Comment #23
gotheric CreditAttribution: gotheric commented@obrienmd: Yes, i've tested it only with the latest version of Drush.
Do you think is there a need to support old versions? (From my knownledge of drush, the only reason to have drush 4.x is if you have Drupal 5 sites)
Comment #24
obrienmd CreditAttribution: obrienmd commentedI know a popular aegir installation system (BOA) and few how-to / scripts still install Drush 4. I use BOA stable, so until that goes Drush 5 for mainline, I can't start using it.
Not sure of stats, but I think Drush 4 was extremely popular and stable Drush 5 is fairly new.
If supporting Drush 4 is not a massive pain, I think it's worth it, but I am clearly biased :)
Comment #25
thedavidmeister CreditAttribution: thedavidmeister commentedYes, please make sure to support drush 4.
Upgrading to drush 5 is relatively simple in itself, but only the most recent versions of Aegir support it #1433406: Make hosting (specifically hosting-dispatch) work with Drush 5. Anyone working with versions of Aegir installed on servers more than a couple of months ago can't upgrade to drush 5 without breaking the Aegir-managed-cron completely.
Unfortunately, not everyone who develops Drupal/PHP is able to change the configuration of the servers they deploy to and this is a rather old ticket so it would be nice if the solution worked for people who aren't using only bleeding edge stuff.
Comment #26
obrienmd CreditAttribution: obrienmd commentedI'd definitely be interested in sponsoring this. Would that help?
Comment #27
gotheric CreditAttribution: gotheric commentedI've just committed a new DEV version that should work in Drush4. Wait for it in download packages.
Comment #28
thedavidmeister CreditAttribution: thedavidmeister commentedsweet. Does this work in both 6.x and 7.x branches?
Comment #29
obrienmd CreditAttribution: obrienmd commentedIt's possible I missed something, but it looks like this was only against 7.x... Then again, I'm not sure if the issue even existed in 6.x. Does anyone know if this showed up in 6.x?
Comment #30
thedavidmeister CreditAttribution: thedavidmeister commentedI am not able to run cron through drush with Elysia Cron in D6. As to whether that's the same issue as what was fixed here or something unrelated I couldn't say :P
Comment #31
Yorgg CreditAttribution: Yorgg commentedIn my case, drush fails to recognize elysia:
$ drush elysia-cron run
Command elysia-cron needs the following module(s) enabled to run: [error]
elysia_cron.
The drush command 'elysia-cron run' could not be executed. [error]
$ drush en elysia_cron
elysia_cron is already enabled. [ok]
There were no extensions that could be enabled. [ok]
As you can see, elysia_cron is already enabled
Anyone else with the same issue?
Comment #32
gotheric CreditAttribution: gotheric commentedVery strange issue.
Are you using 2.x-dev version? (This has a much better drush support than 2.1)
Try running "drush elysia-cron" with no parameters to see it the help message runs.
Comment #33
pjcdawkins CreditAttribution: pjcdawkins commented@staminna that's probably due to the long standing Drush cache bug, not Elysia Cron specific. Run "drush cc drush" first.
Comment #34
Yorgg CreditAttribution: Yorgg commented@gotheric now I've updated to dev and it works fine again
@pjcdawkins: Thanks, that also helped
Comment #35
MacMladen CreditAttribution: MacMladen commentedThis issue got stuck with some questions that seem to me off-topic.
Executing
drush cronfails with error:Drush command terminated abnormally due to an unrecoverable error. [error]while
drush elysia-cronexecutes without problem.As seanburlington pointed out 4 years ago in #2 there was and still is a problem with it. I am not sure if I understood, if it is solvable or not.
So lets see if this can be solved, if it cannot, than it should be noted on project page as a standing issue otherwise people will pull hair :)
Comment #36
Raphael Apard CreditAttribution: Raphael Apard commentedI think this is fixed in dev version.
Someone could confirm ?
Comment #37
helmo CreditAttribution: helmo at Initfour websolutions commentedYes the latest dev version works just fine when you call
drush core-cron. So running it under Aegir is also not a problem.Calling this fixed... although a new release would help get this out there.