CinecaElearning / moodle-mod_attendanceregister

Attendance Register activity module for Moodle 2
7 stars 8 forks source link

Receiving error when Cron Job is running #3

Open aearleycaw opened 7 years ago

aearleycaw commented 7 years ago

I am receiving an error when the 'mod_attendanceregister\task\cron_task' Cron Job is running. We have been unable to find the cause of this issue and I am wondering whether you had some insight into what might be causing this.

The error output is below, this is what is given after trying to run the scheduled task in CLI.

`... used 227.52029895782 seconds Scheduled task failed: Recalculate attendanceregister sessions (mod_attendanceregister\task\cron_task),Error reading from database Default exception handler: Error reading from database Debug: SELECT * FROM mdl_task_scheduled WHERE classname = ? [array ( 0 => '\mod_attendanceregister\task\cron_task', )] Error code: dmlreadexception

!!! Error reading from database !!! PHP Fatal error: Uncaught exception 'coding_exception' with message 'Coding error detected, it must be fixed by a programmer: A lock was created but not released at: /var/www/html/moodle/lib/classes/task/manager.php on line 475

Code should look like:

$factory = \core\lock\lock_config::get_lock_factory('type'); $lock = $factory->get_lock(Resource id #658); $lock->release(); // Locks must ALWAYS be released like this.

' in /var/www/html/moodle/lib/classes/lock/lock.php:117 Stack trace:

0 [internal function]: core\lock\lock->__destruct()

1 {main}

thrown in /var/www/html/moodle/lib/classes/lock/lock.php on line 117 `