My scheduled cron job has been running successfully for quite some time. It works for aggragator and indexing search. But recently I began using simple news with a volume of about 225 subscribers - beyond the save and send limit. Therefore I expected cron to kick in and send the emails later. It doesn't work. But, when I use my browser to run cron e.g. http://www.mysite.com/cron.php the emails go.

I've been researching for a while and honestly am not so sure whether this is a cron configuration issue or a bug in simplenews. By all means, if I miss categorized, I apologize. But since cron works for my other scheduled processes, I thought it might be simplenews specific.

More details on my research and my particular configurations:

The following post appears to be quite related with my issue http://drupal.org/node/85959
But I don't have organic groups. However, the newsletters on this site are only for authenticated users. Based on that thread, I added the ability for authenticated and anonymous users to "send emails" in Access Control. Even after this configuration change, the scheduled cron wouldn't send emails.

I then read up on drupal cron configuration instructions http://drupal.org/cron

My cron was configured as follows:
0 * * * * GET http://www.mysite.com/cron.php > /dev/null

The official drupal recommendations are to use either the lynx or wget commands. Nowhere in any of the threaded discussion is GET mentioned (except for my unanswered post there). I must admit that much of the explanations simply confused me - my sysadmin skills are still rusty. I tried both the recommended lynx and wget commands, but received permission denied errors from my hosting provider (site5).

I guess the question is - should simplenews be able to work with the GET command, the same way that aggragator and search do - and therefore a bug?

Or do I need to reconfigure my cron job for some reason?

Thanks in advance!

Comments

jonesmac’s picture

This is what is going on for me as well. A full cron runs, but after that, my log is filled with errors saying most people (225+) are not getting it and there is simply an explanation that says "error"
I also use the get function as well for my cron tab. Sounds like a bug to me as well.

Any one got a beat on this?

john spain’s picture

I had a similar problem: cron.php invoked from the browser worked OK, cron.php invoked by the system crontab did not.

My problem was that my newletter was categorised and I had not given anonymous users permission to view the newsletter category. Because the system crontab process invokes the cron.php as an anonymous user, the database query was returning an empty dataset.

Once I had set the category permissions to allow anonymous access it worked OK.

On my site we allow anonymous users access to the newsletter - if we didn't we might have to hack the simplenews.module to remove the call to db_rewrite_sql in the _sn_send function. We plan to use cron for some other tasks as well so will have to watch out for this one elsewhere!

gtaylor’s picture

Unfortunately, my newsletters were not available for view by anonymous. So that didn't work for me.

However, another thread here at drupal discussing cron suggested that I try the curl command. That appears to be working fine now.

Command I'm using:

nice -n 17 /usr/bin/curl -k http://mysite.com/cron.php >/dev/null
sutharsan’s picture

Status: Active » Closed (fixed)