Since I've updated my Drupal installation from 6.4 to 6.5, whenever a module update is available, I get one email per cron job cycle advising me of this event. I've set up my cron service to run every 15 minutes, thus I'm notified 4 times per hour! Disregarding my settings in admin/reports/updates/settings whether to check for updates dailiy or weekly.

Comments

Garnerin’s picture

Title: Email notification every cron run when module updates are available » Email notification on every cron run when module updates are available

I see, the actual problem is rather the update check on every cron run than the emails one gets. But it has a certain impact on my mailbox, you know... I'm going to remove my email address in the settings for a while.

djmabo’s picture

I have the same problem.

djmabo’s picture

Version: 6.5 » 6.6

I have the same problem.

Jorge Campo’s picture

Same problem too.

I removed my email for notifications but obviously I have to check for updates manually.
When I put it back my email I get the notifications again every five minutes or so.

I am not sure if the issue was there under the 6.5 version. Right now I have the 6.6 version.

Jorge Campo’s picture

I just checked my logs.
The cron is supossed to run by its defaults values every 60 minutes and retry in case of error every 10 minutes.

However in my logs the cron runs exactly every five minutes: admin/reports/dblog (filter: "cron").

Checking the machine producing the cron to run it gives me an IP 75.101.228.155 which corresponds to Amazon.com

Do you have the amazon module on your systems?

Perhaps this issue it has something to do with that.

Jorge Campo’s picture

I created a support request in amazon module queue:
http://drupal.org/node/329862

Garnerin’s picture

No, I haven't installed the amazon module. I haven't even known about it until now. I encountered the problem without it.

Jorge Campo’s picture

Garnerin,

See if you can check your logs, as I did.
If you have an IP machine running every five minutes, with an ip lookup webpage like http://ip-lookup.net/ perhaps we can shed some light on this issue.

Garnerin’s picture

jcampo,

I've done, but I cannot find any remarkable in there. My cron log records were written every 15 minutes, that's the period I've set up my cron job to run. The IP address mentioned in such a record points to my web host -- just as it should do. Sorry, it doesn't seem to help in light shedding...

djmabo’s picture

I haven't amazon module too

Jorge Campo’s picture

I had the cache enable here:
http://YOURWEBPAGE/admin/settings/performance

It runs every 5 minutes.
I changed to 15 minutes but still I got the same notifications every five minutes (not entirely tested).

I disabled the cache and the messages are not coming anymore.

Could it be the case for you too?

Garnerin’s picture

No, I have disabled the cache all the time, normally. For some other reason, for testing another module, I turned the cache on and off some times in the past, but that didn't have impact on the update check period.

Again, my problem is the check for updates with every cron run and, if an update is available, the repeating email notification with every update check, no more, no less. I get the feeling that we're slightly wandering from the subject...

angelopc’s picture

I've got the same issue. No Amazon module. Poormanscron set to run every hour. Cron runs every five minutes by the same IP address (75.101.228.155).

drupaloSa’s picture

same as #13.

Jorge Campo’s picture

The courious thing with that IP is that it corresponds to Amazon.
See for yourself introducing the IP here:
http://www.arin.net/whois/

Jorge Campo’s picture

Garnerin,
sorry I cannot be more helpful. I re-read your first post and I was under the same symptoms.

We will need somebody more technical taking a look at this.

9dots’s picture

Also experiencing the same problem

AlainS’s picture

The cron.php request probably comes from Acquia'a AWS server. Did you download the Acquia package ?

Garnerin’s picture

No, I didn't. Never heard of that Acquia package.

Jorge Campo’s picture

In my case I did not have acquia either (only mollom).

Alains message gave me an idea: I decided to download acquia and let him administer cron...and it worked!
I do not get the notification mails anymore every five minutes. I just get only one.

I do not know if this issue is produced by poormanscron or is something else.
Perhaps others can try acquia and see if it works for them.

Anonymous’s picture

It's probably Acquia (www.acquia.com). But I can't find the switch to turn off their CRON, so I hacked the cron.php:

if (($_SERVER['REMOTE_ADDR']) <> '75.101.228.155') {
	
include_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
drupal_cron_run();

}
pwolanin’s picture

Acquia.com will only be pinging your site if you (or someone) signed up for a subscription or a trial subscription and entered your site URL (or IP address).

David_Rothstein’s picture

Also, if you have an Acquia subscription, you can turn off the cron service by logging in to acquia.com, clicking on your subscription name in the Site Selector menu, then "Settings", then "Cron"...

However, I think it's clear from the original bug report that this is something which occurs independently of whether it's Acquia running cron for you or not. (Acquia's default cron interval is 5 minutes, though - so obviously the bug will be a lot more annoying if you are running cron that often :)

Palo M.’s picture

Version: 6.6 » 6.9

I just turned e-mail notification on and I noticed I'm having the same problem.
I run cron every 30 minutes and notifications are coming each time.
I do not have Acquia, it's surely coming from Drupal itself.

Also, I must mention, that not only notification comes with each run of cron, but also the event log (on admin/reports/dblog) shows for EACH run of cron that the information about updates has been collected! Also when I run cron manually, there is check for updates!

Regardless I set it (on admin/reports/updates/settings) to weekly or daily, whether there should be an e-mail notification or not, Drupal is always checking for updates with each cron run.

joshmiller’s picture

Version: 6.9 » 7.x-dev

If we can find the problem and fix it, the change will have to happen first for Drupal 7.x

That being said, here's what I've collected about how drupal is handling sending the emails.

 // cron.php
if (isset($_GET['cron_key']) && variable_get('cron_key', 'drupal') == $_GET['cron_key']) {
  drupal_cron_run();
}

Notice how that if statement above is checking for a cron_key. This cron_key is designed to keep remote sites from running your cron for you (that should alleviate some concerns). That is from D7, so not sure if D6 has this particular convention.

 // drupal_cron_run() is found in includes/common.inc
module_invoke_all('cron');

That function above makes sure we aren't running more than one cron.php instance at a time. And then it calls "module_invoke_all()" which will invoke the update module's cron funtion...

 // update_cron.php from update.module

/**
 * Implementation of hook_cron().
 */
function update_cron() {
  $frequency = variable_get('update_check_frequency', 1);
  $interval = 60 * 60 * 24 * $frequency;
  // Cron should check for updates if there is no update data cached or if the configured
  // update interval has elapsed.
  if (!cache_get('update_info', 'cache_update') || ((REQUEST_TIME - variable_get('update_last_check', 0)) > $interval)) {
    update_refresh();
    _update_cron_notify();
  }
}

If you read those lines above correctly, this function is enforcing the variable "update_check_frequency." The default setting is 1 day, but it also enforces an update if the cache_get() functions return "false." (meaning cache has not been created). So that's where our bug lives, if it exists at all.

Hope that helps.

Josh

dave reid’s picture

Component: update system » update.module

Moving to the proper queue. The update system relates to update.php, while update.module is the "available updates" page, etc.

dww’s picture

Status: Active » Closed (duplicate)