Cron fails

Cron fails

by David Conrad -
Number of replies: 4

Greetings all - We just upgraded from 2.8.4 to 3.0.3 and are having a problem with emails not being sent to forum subscribers. I checked the scheduled tasks page and the crons haven't run at all since our upgrade. I used the URL site/admin/cron.php and here's what came up: 

Execute scheduled task: Legacy cron processing for plugins (core\task\legacy_plugin_cron_task)

... started 17:33:28. Current memory use 22.5MB.

Running auth crons if required...

Running enrol crons if required...

Running cron for enrol_manual...

Verifying manual enrolment expiration...

...manual enrolment updates finished.

manual enrolment expiry notifications were already sent today at Monday, May 16, 2016, 6:51 AM.

Running cron for enrol_self...

Verifying self-enrolments...

...user self-enrolment updates finished.

No expired enrol_self enrolments detected

self enrolment expiry notifications were already sent today at Monday, May 16, 2016, 6:51 AM.

Starting activity modules

Processing module function chat_cron ...

... used 6 dbqueries

... used 0.048547983169556 seconds

done.

Processing module function quiz_cron ...


  Looking for quiz overdue quiz attempts...

Potential coding error - active database transaction detected during request shutdown:

* line 1873 of /mod/quiz/attemptlib.php: call to moodle_database->start_delegated_transaction()

* line 1725 of /mod/quiz/attemptlib.php: call to quiz_attempt->process_finish()

* line 79 of /mod/quiz/cronlib.php: call to quiz_attempt->handle_if_time_expired()

* line 535 of /mod/quiz/lib.php: call to mod_quiz_overdue_attempt_updater->update_overdue_attempts()

* line 93 of /lib/classes/task/legacy_plugin_cron_task.php: call to quiz_cron()

* line 75 of /lib/cronlib.php: call to core\task\legacy_plugin_cron_task->execute()

* line 61 of /admin/cli/cron.php: call to cron_run()


Average of ratings: -
In reply to David Conrad

Re: Cron fails

by Ken Task -
Picture of Particularly helpful Moodlers

Don't think there is anything in Moodle code that would do this:

"active database transaction detected during request shutdown"

That looks (?) to be a request to shutdown the DB server?   Have any process that restarts the DB server as part of a cron job?

Might help to disclose a little more info about system.  From clues provided so far ... on Linux or Mac but which and what, etc..   DB server local host or a dedicated DB server?   Remotely hosted?   Dedicated or shared server?

Email issue might best be handled in a separate posting also - although that could also require some additional info (such as above) to be discussion/cussion.

'spirit of sharing', Ken


In reply to David Conrad

Re: Cron fails

by Sam Stevens -

Just double check your php script run times and ram allocation first as that can give all kinds of odd errors if it is hit by cron.php


So that is max_execution_time and memory_limit in php.ini.



In reply to Sam Stevens

Re: Cron fails

by Colin Misbach -

Working with David Conrad

Found a similar issue here:

https://moodle.org/mod/forum/discuss.php?d=324553

Looks to me like it could be a quiz that cannot be completed. How can we find a quiz attempt that is hung? Possibly because of changes made to the quiz before during the attempt?


Also we are getting this message over and over again in the debugging:


PHP Notice:  Can not regrade non existing category* line 396 of /lib/grade/grade_category.php: call to debugging()

* line 235 of /lib/grade/grade_category.php: call to grade_category->qualifies_for_regrading()

* line 2033 of /lib/grade/grade_category.php: call to grade_category->update()

* line 2034 of /lib/grade/grade_category.php: call to grade_category->get_children()

* line 2034 of /lib/grade/grade_category.php: call to grade_category->get_children()

* line 2034 of /lib/grade/grade_category.php: call to grade_category->get_children()

* line 2034 of /lib/grade/grade_category.php: call to grade_category->get_children()

* line 2034 of /lib/grade/grade_category.php: call to grade_category->get_children()

* line 2034 of /lib/grade/grade_category.php: call to grade_category->get_children()

* line 2034 of /lib/grade/grade_category.php: call to grade_category->get_children()

* line 2034 of /lib/grade/grade_category.php: call to grade_category->get_children()

* line 2034 of /lib/grade/grade_category.php: call to grade_category in /srv/www/malone.learninghouse.com/lib/weblib.php on line 2934

In reply to David Conrad

Re: Cron fails

by Colin Misbach -

Heads up we solved the issue. 

Went to mdl_quiz_attempts and queried for state='inprogress' with a timecheckstate!=NULL

Found the quiz, could not access it from the GUI. Page was timing out.

Deleted the quiz, then the course, since the course was not in session. It was actually a backup of a course made because the original course was having backup and restore issues.

Ran the cron and it worked.