I was trying to run cron.php via host provider, but I discovered that it only runs with authenticated users.
But I also discovered this great solution that allows cron to run by anonymous users: http://drupal.org/node/995514#comment-4373006
Now cron runs ok, once per hour
It is being run via HostMonster cPanel cron:
"-0 * * * * /ramdisk/bin/php5 -c home1/client/public_html/php.ini /home1/client/public_html/newsite/na/cron_user1.php"
But beyond the line informing that the cron was run properly, I get along with other line always this error:
(http:///?/home1/client/public_html/newsite/na/cron_user1.php): "Domain access failed to load during phase: bootstrap include. Please check your settings.php file and site configuration."
However my settings.php is configured correctly with these lines:
/**
* Add the domain module setup routine.
*/
include './sites/all/modules/domain/settings.inc';
This error in itself apparently does not cause any problems to the site, but maybe it can be avoided.
Any ideas?
Comments
Comment #1
agentrickardThis happens because Drupal's cron process expects to be run with a full HTTP request string. When one is not available, as in the direct cron code you are using, domain lookups fail.
See https://drupal.org/cron
One solution, if you have drush on the server, is to call cron via drush instead:
This warning is harmless in your case -- it means that all cron requests will run under your default domain. There is no simple way to disable it.
Comment #2
agentrickardBetter title.
Comment #3
texas-bronius commentedHi Folks-
We recently enabled elysia_cron on a project, and our watchdog is slammed with the same error message including Location: http:///. I think the two are correlated (in our case) and wanted to share this tidbit fwiw.
-Bronius
Comment #4
agentrickardThe instructions for setting up Drupal cron clearly state that you should pass a url value for this very reason.
https://drupal.org/node/23714
Comment #5
agentrickardYou can also disable this message in settings.php if you can't fix your cron script.
Add this to settings.php (at the bottom):
Comment #6
texas-bronius commented@agentrickard- Would it be possible/appropriate in the testing for and falling back to default domain bit of domain init to also check against empty domain? You still want to throw error for bad bootstrap and for "legitimately unrecognized domains", but if the issue occurs widely enough that cron is called "from" http:/// for my or others' use cases, then handling it would squash all errors: It could still be helpful to provide documentation that says, "Oh by the way, call each specific domain's cron, if that's important to your application" but even that is probably an edge case.
Are there other reasons the failure at phase bootstrap might falsely report that settings.php was not configured, and is there a better or more specific test to run? Perhaps just the presence and absence of some constant defined only in DA's settings.inc would be a more direct "hey you didn't follow INSTALL.txt, you goof" checker.
-Bronius
Comment #7
agentrickardGiven that cron in Drupal requires a URL, I don't see the point. This is a configuration error.
Comment #8
agentrickardAnd it certainly isn't getting any attention in 6.x
Comment #9
texas-bronius commentedFor what it's worth, my empty requester is Location: https:/// (secure https, not http as reported earlier), but the site is not a secure site. Maybe I've got something else calling and coinciding?..
Also @agentrickard would it make sense instead of using empty($hide) to check on the value of $hide in the event someone wants to keep the definition in settings.php but just toggle it while troubleshooting:
Comment #10
texas-bronius commentedWell dang it-- checking apache logs, looks like nagios is our (us- our, not you folks and me- our) culprit:
My two earlier questions are still valid: Can Domain Access only check for valid domains and, for confirming proper settings.php, include a constant in its settings.inc to look for?
Comment #11
agentrickardNo. These reports are designed to help you troubleshoot. You have ways to turn them off, as noted above.
They are largely for novice users, not advanced users, and their inclusion has made support much, much easier.
Comment #12
rogeriodec commentedGuys: the solution to # 1 is simpler than you might imagine: just create a cron task o cPanel:
curl http://example.com/cron_user1.php