I can not seem to find out what cron.php is doing exactly that it needs to have an ssl connection with Google. I keep getting the following error:

ERROR: Authentication with Google failed. Reason: BadAuthentication

I've Googled it and basically come up with nothing that seems to be similar to my issue. Is there some cron.php configuration parameters I should be setting somewhere?

Thanks in advance,


The "Search" module is the culprit. Here's how I found it. I hacked my cron.php file to add a couple functions it was calling so I could add logging information to help me track down the module. I copied both the module_invoke_all() and drupal_cron_run() functions into my cron.php, renaming them dev_module_invoke_all() and dev_drupal_cron_run(). The dev_module_invoke_all() is the logging is added and is shown below. The change I made in my dev_drupal_cron_run() was simply to change the module_invoke_all('cron') call to dev_module_invoke_all('cron'), so I am not pasting it. Then the cron.php call to drupal_cron_run() is changed to dev_drupal_cron_run() to use my functions. I could then look in the "Recent log entries" under the Report menu to see the last module cron_hook() called. For me, it was the "Search" module. I disabled it, re-ran cron, and it successfully completed.

This is with a Drupal 6 installation.

function dev_module_invoke_all() {
  $args = func_get_args();
  $hook = $args[0];
  $return = array();
  foreach (module_implements($hook) as $module) {
    /*This logs a message out to the Recent Log Entries report.*/
    watchdog('cron', "Calling module: " . $module . " cron_hook: " . $module . '_' . $hook);
    $function = $module . '_' . $hook;
    $result = call_user_func_array($function, $args);
    if (isset($result) && is_array($result)) {
      $return = array_merge_recursive($return, $result);
    else if (isset($result)) {
      $return[] = $result;
  return $return;

Even more info. I added watchdog logging to the search.module's search_cron() to determine which module it was calling and tracked the issue to the node module. I then added watchdog logging to the node.module _update_index function to log out which node was being indexed. I then re-ran the cron and found the offending nodes. There turned out to be a couple of issues: A PHP page trying to do openssl authentication which was my original error. That page had been deprecated, but was still in the node list. I deleted the page.


  • Google Analytics module? – Mark G Feb 19 '14 at 18:41
  • That was my thought as well, so I disabled it. Getting the same result. – Dan R Feb 19 '14 at 19:39

Check if you have a module that uses any of the Google's API (translate, maps, youtube, calendar,...).

Seems that one of the modules implements hook_cron() where is trying to access to one of the Google services through its API.

If that is the case at Google Cloud Platform you can configure a key to solve the issue.

If that is not the problem, try to check the logs to see if you can get more info about this error.

  • I'll go through them and look again, I got rid of the gmap and statistics module on the test install but still had the issue. – Dan R Feb 20 '14 at 10:54
  • I may have found the culprit. Found in constant_contact's changelog: "17.) Installation improved, it now checks openssl and the fsockopen function are working correctly by trying to establish a connection with google.com." – Dan R Feb 20 '14 at 13:27
  • Looks like that hole goes nowhere, disabled, then moved module out of install and still get same error. Is there a way to get any debugging info from the cron to figure out at which point this is occurring? – Dan R Feb 20 '14 at 13:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.