When I look in my admin log, I see a lot of messages saying that the cron run did not finish. But there is no indication of the reason for this. Could it be something to do with Simplenews? The news certainly seems to take a long time to get sent. I notice that when I run cron "by hand" it works fine, I don't get the "did not complete" message. Any ideas would be welcome...

Comments

IGadmin’s picture

I also am seeing the odd cron job not finishing when sending a simplenews newsletter. Some stats: my list is 3500+ people, and am throttling 100 mails per cron run. Am on Drupal 4.7.6.

Also, I'll occasionally see watchdog reporting multiple cron jobs executed per scheduled cron run, often 4-5 instances of cron time-stamped the exact same, reporting "cron run completed", when only ONE should have run. I'm unclear whether simplenews actually IS sending 100 emails for each one of these instances, even though it apparently THINKS it is, as it finishes sending to my 3500+ list earlier than expected.

Could use help with this, as my hosting provider throttles me to 1,000 emails sent an hour. When simplenews spits them all out faster than it should, as above, half my emails are quietly being throttled by my hosting provider, so the recipients never get them.

beginner’s picture

Title: Cron not finishing - is this Simplenews? » Cron not finishing - User receiving multiple copies
Category: support » bug

I confirm all the symptoms described above.
1300+ emails, and I tried sending 200 newsletter per cron run, which obviously is too much.

symptoms:
- "cron not completed" errors in the logs
- cron runs multiple times in the same minute, at the time it is supposed to run, even though is says it completed.
- users complain that they receive multiple copies of the newsletter.

This is actually a core problem that has been fixed in Drupal 5: cron could be run multiple times, causing troubles like this one. In Drupal 5, cron sets a flag that prevents multiple runs of cron.

I am going to upgrade to D5, now and I guess everybody using simplenews.module should do the same.

It's not something that can be solved with this module.

leave this issue open until Drupal 4.7 is no longer supported, so that people can find it.

beginner’s picture

Actually, I have found that cron is actually running twice every hour instead of once. There is another problem going around.

Also, what may be relevant is the cron script you use. I am using scripts/cron-lynx.sh. And you?

IGadmin’s picture

Every 10 minutes, I'm invoking a cron job using the following:

/usr/bin/wget -O - -q http://[ip address, removed for security]/cron.php

Should I be running the script directly from the script folder? If so, what's the right syntax?

beginner’s picture

my comment #3 is not relevant. I since found out that my host had somehow duplicated the cron job, making it run twice. The duplicate has been removed and now everything is ok.

IGadmin: you use Drupal 4.7, right? This is a core problem: upgrade to D5.
Or do ALL of the following:

1) run cron less often (once per hour is enough),
2) send much fewer emails per run (50?)
and
3) make sure cron is never run twice at the same time.

Tigerhuli’s picture

Try to check your system time!
I solved the similar problem by correcting the server system time, which was way off.

Taekyon’s picture

Version: 4.7.x-1.x-dev » 5.x-1.2

I have the same problem with a newsletter on a drupal 5.7 site. Some people receive up to four copies of the newsletter. Others just one.
Cron is handled by poormanscron. Could that be (part of) the problem?

sutharsan’s picture

The problem is usually a cron overrun. The previous cron job is not finished before a new one is started. Decrease the number of newsletters per cron job or a bigger interval between the jobs.

sutharsan’s picture

Assigned: Unassigned » sutharsan

I will to add some instructions on this subject in the documentation.

sutharsan’s picture

Status: Active » Fixed

README.txt now contains this instruction:

SEND NEWSLETTERS WITH CRON
--------------------------

Cron jobs are required to send large mailing lists. Cron jobs can be triggered
by Poormanscron or any other cron mechanisme such as crontab.
If you have a medium or large size mailinglist (i.e. more than 500
subscribers) always use cron to send the newsletters.

When you use cron:
* Set the Initial send time to zero seconds.
Failure may lead to sending duplicate newsletters.
* Make sure the number of newsletters send per cron run (Cron throttle) is not
too high.
Too high values will lead to the warning message 'Attempting to re-run cron
while it is already running'

When you do not use cron:
* Set the Initial send time high enough to send all newsletters.
Failure may lead to receipients not receiving their newsletter.

These settings are found on the Newsletter Settings page at:
Administer > Content Management > Newsletters > Settings > General

sutharsan’s picture

Assigned: sutharsan » Unassigned
Anonymous’s picture

Status: Fixed » Closed (fixed)

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