Hi,

I seem to be having this problem after upgrading from D6 to D7 .. when cron runs crashes our server.

Location http:///?/home/public_html/cron.php

I agree the above location is incorrect, so disabled the internal cron (admin/config/system/cron) in D7 to 'run cron never' and setup a cron via cpanel with the external cron path key which runs without every hour problem.

Yet every 8 hours or so another cron runs, don't know where it comes from with the following errors:

Notice: Undefined index: REQUEST_METHOD in _block_render_blocks() (line 830 of /home/public_html/modules/block/block.module).

Notice: Undefined index: REQUEST_METHOD in module_implements_write_cache() (line 770 of /home/public_html/includes/module.inc).

Notice: Undefined index: SCRIPT_NAME in request_uri() (line 1591 of /home/public_html/includes/bootstrap.inc).

Notice: ob_flush() [ref.outcontrol]: failed to flush buffer. No buffer to flush. in drupal_page_footer() (line 2571 of /home/public_html/includes/common.inc).

Notice: Undefined index: REQUEST_METHOD in SchemaCache->__construct() (line 2815 of /home/public_html/includes/bootstrap.inc).

Cron could not run because an invalid key was used.

Notice: Undefined index: REMOTE_ADDR in ip_address() (line 2741 of /home/public_html/includes/bootstrap.inc).

Notice: Undefined index: SERVER_SOFTWARE in require_once() (line 13 of /home/public_html/includes/mail.inc).

Please how can I track down this other cron and where it comes from, and perhaps if found, can correct it's path, or do I perhaps have another issue in play here?

Looking most forward to any reply, and thank you.
Lilian

Comments

selinav’s picture

Same problem on a clean install D7

solimeno’s picture

I had this same problem and found the solution tonight ... there is a long key string required to be appended to the cron command. It can easily be found on your site from the Administration console (.../admin/reports/status) in Status Reports:

http://www.example.com/cron.php?cron_key=HTQ3--utwpEOmVV0LlAPJAqbw9QWBqA...

Check your crontab entry ($crontab -e) and if your cron job line ends like "http://www.example.com/cron.php" then you need to replace it with the link from your Status Reports page that immediately follows "To run cron from outside the site, go to" ...
and that should fix it.

At least that fixed it on my server ... when I ran the new cron job I found it ran successfully in the log whereas it reported the error before: "Cron could not run because an invalid key was used."

sleepingmonk’s picture

Wow! This may have been my problem for the last few weeks. Thank you for posting your solution.

--
To Your Success!

hanna_ulrika’s picture

Hi,

I have a similar problem on a fresh Drupal 7 install. I disabled the poormanscron by setting the frequency to "Never", and added a crontab entry in cpanel, like so:

/usr/bin/php /home/username/public_html/cron.php cron_key=(the cron key here)

The log says "cron run completed", by I also get a list of various "Notice: Undefined index: ..." They all have this funny url as location:

http:///?/home/username/public_html/cron.php

Please notice that I don't use the url to cron.php in the cron command, instead I use the path starting with the /home/ directory. Is this the cause of the problem? I rather not use the url since the domain name is not pointing to this domain yet (I've set it up in my local hosts-file when working with the site).

eeyorr’s picture

Try this command in cpanel: wget http://yourdomain.com/cron.php?cron_key=(the cron key here)

agenciaq1’s picture

I tried the command below as suggested by eor and it's working to me now.

wget http://yourdomain.com/cron.php?cron_key=(the cron key here)

Thank you,