Fatal error: Call to undefined function supercron_module_invoke_all_cron() in /home/www/servers/v2/supercron.php on line 89

Comments

geerlingguy’s picture

I'm getting the following when loading the Crontab configuration page:

Fatal error: Call to undefined function supercron_standard_path() in /home/review/public_html/sites/all/modules/supercron/supercron.crontab-admin.inc on line 38

...and I'm also getting the same fatal error when running cron via example.com/cron.php

Fatal error: Call to undefined function supercron_module_invoke_all_cron() in /home/review/public_html/supercron.php on line 89

[Edit: Finally, I'm getting a message on my site that the supercron.php file hasn't been copied to the site root directory... when, in fact, it has. Here's the message that's popping up (below):]

The supercron.php file should be copied from the /home/review/public_html/sites/all/modules/supercron directory to /home/review/public_html/; until that is done, your cron-driven tasks will not execute when scheduled to.

[Edit 2: I also am now getting the following fatal error if I invoke all the cron tasks manually at admin/settings/supercron (below):]

Fatal error: Call to undefined function supercron_get_script_url() in /home/review/public_html/sites/all/modules/supercron/supercron.inc on line 327

MisterSpeed’s picture

Thanks ! We're looking at this, but are bumping heads with a deep issue with Drupal not going through its full bootstrap, so the drupal_get_path function fails. We'll probably only get back to this in about a week though as the staff is on vacation next week. We'll advance the module so that we can share code with the D7 version at the same time.

jannalexx’s picture

supercron.admin.js located in wrong directory http://drupal.org/node/748496
check if this one solves any of those errors

jgcracknell2’s picture

Version: 6.x-1.4-beta1 » 6.x-2.x-dev

Hi

moving .js to the js directory doesn't solve the issue I still get the error message on line 38

Oscar Illada’s picture

I'm getting the following when loading the Crontab configuration page too.......
Fatal error: Call to undefined function supercron_standard_path() in sites/all/modules/supercron/supercron.crontab-admin.inc on line 38
but if a run the cron or if i do somethings(who knows!!), it works..

Help please!!!!!
Thanx Oscar

MisterSpeed’s picture

We got rid of an underlying issue with out-of-order Drupal bootstrap calls that should resolve the issue; we'll commit code in a few days.

MisterSpeed’s picture

Status: Active » Fixed

Should be fixed in the latest release; if not pls re-open. Thanks !

nardberjean’s picture

I see no real change with the latest -dev. supercron.php file has same modification date as previous version.

MisterSpeed’s picture

Did you try it ? supercron.php has almost no functionality left in it, otherwise roughly 40% of the code has changed.

nardberjean’s picture

Title: Fatal Error on cron call » I am surprized it can change content but not modification date...

Thanks to let me know!

geerlingguy’s picture

Title: I am surprized it can change content but not modification date... » Fatal Error on cron call

n/p

Status: Fixed » Closed (fixed)

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

TallDavid’s picture

Status: Closed (fixed) » Active

Problem is still occurring on the May 16, 2010 version of dev code:

Fatal error: Call to undefined function supercron_standard_path() in .../sites/all/modules/supercron/supercron.crontab-admin.inc on line 38

Note to self: ttoh

ddv’s picture

I downloaded and installed the May 16 build this morning and was getting both errors:

Fatal error: Call to undefined function supercron_module_invoke_all_cron() in
/home/.morna/[user]/[mysite]/supercron.php
on line 89

(when clicking on the configuration tab)

and

The supercron.php file should be copied from the /home/[user]/[mysite]/modules/supercron directory to /home/[user]/[mysite]/; until that is done, your cron-driven tasks will not execute when scheduled to.

Then the first error mysteriously disappeared by the time I found this thread (1/2 hour?). Once able to access the configuration screen, I changed the location of supercron.php from the /modules/supercron setting to the drupal root directory and when I went back to the Settings tab, the warning was gone.

ddv’s picture

As of 9 am today, I started getting

Fatal error: Call to undefined function supercron_module_invoke_all_cron() in /home/[user]/[mysite]/supercron.php on line 89.

every hour on the hour.

but it seems to run fine if invoked manually through the "Invoke all cron jobs" link (to http://[mysite]/admin/reports/status/run-supercron).

ddv’s picture

Update:

I still get the fatal error message -- even with the entire list disabled.

And I have the "supercron.php file should be copied from..." error back again. So I tried to access the configuration settings, but when I click on that tab now I get: Fatal error: Call to undefined function supercron_standard_path() in /home/.morna/[user]/[mysite]/modules/supercron/supercron.crontab-admin.inc on line 38"

kroza’s picture

I made it works in this way:

function supercron_invocation_form(&$form_state) {
  $module_path = drupal_get_path('module', 'supercron');
  drupal_add_js("{$module_path}/js/ZeroClipboard.js");
  drupal_add_js("{$module_path}/js/supercron.crontab.js");
  drupal_add_js(array('supercron_module_path' => drupal_get_path('module', 'supercron')), 'setting');

+  module_load_include('inc', 'supercron', 'supercron-main');
sajosh’s picture

Adding comment #17 line fixed it for me. Now the page loads.

For the module developers, I have ...

D6.17,

; Information added by drupal.org packaging script on 2010-07-11
version = "6.x-2.x-dev"
core = "6.x"
project = "supercron"
datestamp = "1278835830"

Anonymous’s picture

Also add #17 in supercron.php before supercron_invoke_one($module, FALSE, $multithread);

sf_wind’s picture

subscribe.. waiting to see whether there is any solution...

Andy B’s picture

subscribe

Also waiting for an update. Just tried #17's trick as well as putting it in supercron.php. Now off to see how it works...

Update: I was able to access the crontab settings page after changing the code in #17. I tried putting it in supercron.php but it had no affect. Remaining issues are:

1. I keep getting reminded to make sure supercron.php is located in the right place. It says that supercron.php should be copied to "e:\www\public_html\[username]\drupal\index.php\supercron.php". I have no idea why index.php is even included in the path.
2. Assuming that this is related, I can't save changes to the supercron.php schedule.

Any ideas of an alternative cron module until this gets fixed? I don't have access to crontab creation but I also don't want to rely on page hits to run cron either.

geerlingguy’s picture

Andy B’s picture

Status: Active » Needs work

Here is a summary of what to do in almost all cases to get rid of these errors:

1. Edit sites/all/modules/supercron/supercron.crontab-admin.inc. Look for the following lines of code:

function supercron_invocation_form(&$form_state) {
$module_path = drupal_get_path('module', 'supercron');
drupal_add_js("{$module_path}/js/ZeroClipboard.js");
drupal_add_js("{$module_path}/js/supercron.crontab.js");
drupal_add_js(array('supercron_module_path' => drupal_get_path('module', 'supercron')), 'setting');

2. After the last line of code above, put the following line of code:

module_load_include('inc', 'supercron', 'supercron-main');
3. Save the supercron.crontab-admin.inc file.
4. Copy supercron.php to a folder of your choice (probably the drupal root).
5. Edit supercron.php. At the top of the file, look for the commented out variable $drupal_dir and do the following to it:
A. Remove the comments.
B. between the apostrophes, type the absolute path to supercron.php. Don't include supercron.php itself and don't include a trailing /.
6. in supercron.php, look for the line:

supercron_invoke_one

7. Just above it, add the following line of code:

module_load_include('inc', 'supercron', 'supercron-main');

8. Save supercron.php and close it.
9. In drupal, go to Administrate>Site configuration>Super cron.
10. Click crontab tab.
11. In the section that asks where supercron.php is located, click other and type the exact same path as you did for the $drupal_dir variable.
12. Click save.

Everywhere you go now, you wont be reminded to set your supercron.php path and the crontab page now loads without errors. Now the suspenseful wait to see if my hosting company will give me the absolute path for php.exe so I can setup the cron jobs for each module. Can the developer at least add these changes to the module code so everyone doesn't have to customize it?

MisterSpeed’s picture

Yes; I am back from vacations. Will follow-up on open tickets and post a new version.

Dubber Dan’s picture

Thanks Andy B, that worked like a charm.

imb123’s picture

Before, I try the solution on number 23, has a patch been issued for this?

bibo’s picture

I'm downgrading to 1.3.

Without this fixed, the 2.x-dev branch is worthless.

bibo’s picture

FYI, the downgrade to 1.3 caused great chaos on the site (apparently because of my uninstall failed). Great chaos being things like panels and views not displaying, modules and includes loading in wrong order etc.

I've since moved to elysia_cron, which actually feels reliable.

murz’s picture

Thank's! Adding string from #17 post solve the problem for me!
But I added this string to supercron.php in root of site, before string
supercron_module_invoke_all_cron();
After that I have this code at end of site:

 else {
  module_load_include('inc', 'supercron', 'supercron-main');

  supercron_module_invoke_all_cron();
} 
cor3huis’s picture

Same issue Fatal error: Call to undefined function supercron_module_invoke_all_cron() experienced here.
The Fix on #23 http://drupal.org/node/747118#comment-3349988 worked for me. However the solution is appreciated IMHO however somewhat messy.

BTW I recall there is the /scripts/drupal.sh which can be called like:

*/15 * * * * /home/yourhosterfirmusername/yourdomain.com/testing/scripts/drupal.sh --root /home/yourhosterfirmusername/yourdomain.com/testing/ http\072//default/supercron.php'

As long as you modified drupal.sh and set the correct php executable to use in the first line of this script, e.g. #!/usr/local/php5/bin/php

It is maybe best just to look in in this script and implement something good from this into the supercron initialization fase

bcmiller0’s picture

tried suggestions above and i'm still having the same issue.

bcmiller0’s picture

this seems in my case to boil down to this:

supercron.inc:
define('SUPERCRON_SCRIPT_PATH_MODULE_ROOT', 2); ????? why is this ???
define('SUPERCRON_SCRIPT_PATH_DRUPAL_ROOT', 1);
define('SUPERCRON_SCRIPT_PATH_MODULE_ROOT', 2);
define('SUPERCRON_SCRIPT_PATH_CUSTOM', 3);

why is this defined as constanct of 2 ???

it is compared here to the variable in file supercron.admin.inc
so it always fails:

function _supercron_check_requirements() {
$supercron_script_path = variable_get('supercron_script_path', SUPERCRON_SCRIPT_PATH_MODULE_ROOT);

if ($superccron_script_path == SUPERCRON_SCRIPT_PATH_DRUPAL_ROOT) {

in fact this is uses in supercron-main.inc as well:

function supercron_get_script_URL() {
global $base_url;
$script_path = variable_get(SUPERCRON_SCRIPT_PATH, SUPERCRON_SCRIPT_PATH_MODU\
LE_ROOT);

if ($script_path === SUPERCRON_SCRIPT_PATH_DRUPAL_ROOT) {
return $base_url .'/'. SUPERCRON_SCRIPT_NAME;
}
elseif ($script_path == SUPERCRON_SCRIPT_PATH_MODULE_ROOT) {
return url(drupal_get_path('module', 'supercron') . 'supercron.php', array(\
'absolute' => TRUE));

bcmiller0’s picture

Status: Needs work » Needs review
StatusFileSize
new4.1 KB

ok this seems to solve at least the warning condition for my setup, and also fixes settings on the 'crontab configuration' page as well.

See patch, seems problem with defines for form used for values when not correct. Probably needs to be cleaner saving these items in the same inc file for re-use in others, but got rid of my warning for now.

bcmiller0’s picture

i did that too fast, and left in my debugging, sigh sorry. here is a better patch.

bcmiller0’s picture

I think the patch on this http://drupal.org/node/994294#comment-3815738 (issue 994294) will resolve issues seen on this page.

escoles’s picture

FYI, seeing this error in the most recent dev release @ this date.

subwoofer’s picture

I am also receiving this error on the latest release

ghmercado’s picture

andy B's solution (http://drupal.org/node/747118#comment-3349988) worked for me.

humbly suggest to devs to postpone version 2 for the meantime until this rather serious error finally get licked. Otherwise supercron is awesomest amongst all cron measures I've tried.

Danzki’s picture

Andy B solution fixes my crontab, however I still get the warning about moving my supercron.php to the root location.

My crontab settings are "module root".