Forums | Mahara Community

Support /
Some e-mails are not being sent


anonymous profile picture
Account deleted
Posts: 48

23 September 2010, 0:47

Hi:

I am runing Mahara 1.3 with PHP 5.2.14 and MySql 5.1.39, and so far is working fine, except for some messages that are not being sent:

-Messages from the Contact form.

-Messages sent to forums.

 

Direct (friend) messages and registration messages are sent.

I have set the noreplyaddress to a valid e-mail address in config.php, and I have set the cron to run every 10 minutes, not each minute as stated in the instructions (that may be the cause?).

Following a sample of the cronjob log:

-------------------

[DBG] ab (lib/cron.php:70) ---------- cron running Wed, 22 Sep 2010 22:10:01 -0700 ----------
[WAR] ab (lib/cron.php:167) core cronjob "rebuild_artefact_parent_cache_dirty" didn't get run because the nextrun time (2010-09-22 22:01:00) was too old (less than 1285218301)
Call stack (most recent first):
 * log_message("core cronjob "rebuild_artefact_parent_cache_dirty"...", 8, true, true) at /home/user/site/lib/errors.php:109
 * log_warn("core cronjob "rebuild_artefact_parent_cache_dirty"...") at /home/user/site/lib/cron.php:167

[WAR] ab (lib/cron.php:167) core cronjob "activity_process_queue" didn't get run because the nextrun time (2010-09-22 22:05:00) was too old (less than 1285218301)
Call stack (most recent first):
 * log_message("core cronjob "activity_process_queue" didn't get r...", 8, true, true) at /home/user/site/lib/errors.php:109
 * log_warn("core cronjob "activity_process_queue" didn't get r...") at /home/user/site/lib/cron.php:167

[WAR] ab (lib/cron.php:167) core cronjob "import_process_queue" didn't get run because the nextrun time (2010-09-22 22:05:00) was too old (less than 1285218301)
- Ocultar texto citado -
Call stack (most recent first):
 * log_message("core cronjob "import_process_queue" didn't get run...", 8, true, true) at /home/user/site/lib/errors.php:109
 * log_warn("core cronjob "import_process_queue" didn't get run...") at /home/user/site/lib/cron.php:167

-------------------

Any hint? Thanks in advance.

anonymous profile picture
Account deleted
Posts: 808

23 September 2010, 20:57

Hi Roberto,

Yes, I think you'll be able to fix this by setting cron to run every minute.

If you don't want cron to run every minute, then there's also another way to fix it: have a look at the 'cron' table in your database, and update the row for 'activity_process_queue'.  If you change the minute column to read '*/10' instead of '*', then that function will get called every 10 minutes, which should stop the 'nextrun time too old' error.  While you're there, you should do the same thing for the 'import_process_queue' and 'rebuild_artefact_parent_cache_dirty' jobs too, because by default they are also both scheduled to run more frequently than every 10 minutes.

[I'm not sure I really understand why the cron script refuses to run things with the 'nextrun time was too old' message, but I'm sure there's a good reason - I'll ask Martyn (who wrote cron.php) next time I see him.]

anonymous profile picture
Account deleted
Posts: 48

25 September 2010, 12:33

Hi Richard:

Thanks for your reply.  Yes it fixed!  I went for your second option, and I changed in the database what you suggested. In my case, runing the cron every 10 minutes is more than enough.

Now all messages are being delivered  and I have no more warnings:

[DBG] 15 (lib/cron.php:70) ---------- cron running Sat, 25 Sep 2010 10:20:02 -0700
[DBG] 15 (lib/cron.php:149) Running core cron rebuild_artefact_parent_cache_dirty
[DBG] 15 (lib/cron.php:149) Running core cron activity_process_queue
[DBG] 15 (lib/cron.php:149) Running core cron import_process_queue

 

 

 

25 November 2010, 1:31

I have a server for 2 (two) services : moodle (version 1.9) and mahara (version 1.3), with Ubuntu 10.04 LAMP package.  I want to install cron job on my machine to serv both services.

  1. I want to be sure that I am doing the right thing. Is my scrip right  (I want to run every 15 minutes) ?

             #     m   h    dom  mon dow command

             15   *     *     *        *       curl  /var/www/eportfolio/lib/cron.php   (eportfolio is mahara root dir)

             15  *      *     *        *       php /var/www/element/admin/cron.php (element is moodle root dir)

       2.  How do I check that my cron job running well?

Thank you

Ruslan Kabalin's profile picture
Posts: 146

25 November 2010, 6:33

Hello Sulaiman,

In order to run every 15 mins (as opposed to at 15 minutes past every hour), you have to set minutes parameter as */15:

*/15 * * * *  curl  /var/www/eportfolio/lib/cron.php

*/15 * * * *  php /var/www/element/admin/cron.php

You may check whether scripts are run in syslog (/var/log/syslog), the actual output should be reflected in apache server error log (/var/log/apache2/error.log). Also, depending on cron configuration, since you do not redirect output from the commands above, it might be that cron will be emailing script output to the user under which the crontab is set.

Also, you said you want to run cron from "your machine" - is it different PC from the server where your moodle and mahara are hosted? If so, you need a slightly different approach.

anonymous profile picture
Account deleted
Posts: 21

25 November 2010, 6:45

If your cron jobs are only running every 15 minutes don't you need to change MAXRUNAGE in cron.php to be much larger?

The default is 5 minutes with cron jobs running every minute, so it'll certainly need to be more than 15 minutes. Otherewise you're guaranteed that jobs will fall outside the MAXRUNAGE and not get run.

Ruslan Kabalin's profile picture
Posts: 146

25 November 2010, 11:02

Good point Garry! If version 1.3 is used, one have to define $cfg->maxrunage in config.php, it should be equial or greather than the time between we hit cron.php, i.e. for 15 mins, one have to set:

$cfg->maxrunage = 900;

Though, from 1.4 this setting will be removed and no longer needed.

25 November 2010, 22:06

Thank you Ruslan,

I will be running cron job from the same machine where my moodle and mahara hosted. Is there any different approach?

Ruslan Kabalin's profile picture
Posts: 146

26 November 2010, 2:57

If it is the same machine, your way of doing is fine.

9 results