I recently changed the completion criteria in a course which meant I had to: 'delete completion data'. I have done this before and then by running the cron it usually checks against the new criteria and re-populates the completion data. Although in this case my cron runs and gets to: 'Running completion_criteria_activity->cron()' then hangs for an hour then finally spits out an IE 'can't find page error'. I have attached the cron script where it hangs. The issue is causing all completion dependent report script to crash the server.
+ I tried Resetting the completion criteria on the course but the data was already deleted so no good- no change.
+ I then tried updating a copy of the database to Moodle 2.2.2 sticking to a pure Moodle Stable site i.e. No hacks. Although same issue occured (Cron hangs at 'Running completion_criteria_activity->cron()' and Completion Reports crash the server).
+ I have also tried the patch [MDL-32203]. (applied manually no errors) - still nothing.
+ I checked most databases tables for duplicate records including ('mdl_course_completion_crit_compl' etc). Still same issue.
+ I have also tryed uping the max 'max_script_run_time' variable in the PHP - Nothing (Actually it still only ran for a hour i.e. no increase in time).
Also the cronn runs all the way through if I edit out the completion cron code from 'moodle/lib/completion/cron.php' and even with developer debugging on I get no stack errors etc - Nothing it just eventually times out.
Please Help - I can't think of anything else to try.
My Cron Script, where it stops.