Thank you Ken for your quick reply unfortunately that didn't work. The fully errors after completing are
used 888385 dbqueries
... used 2496.9658410549 seconds
Scheduled task complete: assessmentgrades (local_assessmentgrades\\task\\assessmentgrades)
',
)]
Backtrace:
* line 1329 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
* line 1375 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
* line 84 of /lib/classes/task/database_logger.php: call to mysqli_native_moodle_database->insert_record()
* line 299 of /lib/classes/task/logmanager.php: call to core\task\database_logger::store_log_for_task()
* line 718 of /lib/classes/task/manager.php: call to core\task\logmanager::finalise_log()
* line 163 of /admin/tool/task/cli/schedule_task.php: call to core\task\manager::scheduled_task_complete()
Default exception handler: Error reading from database Debug: MySQL server has gone away
SELECT * FROM mdl_task_scheduled WHERE classname = ?
[array (
0 => '\\local_assessmentgrades\\task\\assessmentgrades',
)]
Error code: dmlreadexception
* line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
* line 1245 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
* line 1571 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
* line 1543 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
* line 1522 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
* line 678 of /lib/classes/task/manager.php: call to moodle_database->get_record()
* line 181 of /admin/tool/task/cli/schedule_task.php: call to core\task\manager::scheduled_task_failed()
!!! Error reading from database !!!
Debug info: MySQL server has gone away
SELECT * FROM mdl_task_scheduled WHERE classname = ?
[array (
0 => '\\local_assessmentgrades\\task\\assessmentgrades',
)]
Error code: dmlreadexception
Stack trace: * line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
* line 1245 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
* line 1571 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
* line 1543 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
* line 1522 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
* line 678 of /lib/classes/task/manager.php: call to moodle_database->get_record()
* line 181 of /admin/tool/task/cli/schedule_task.php: call to core\task\manager::scheduled_task_failed()
PHP Fatal error: Uncaught coding_exception: Coding error detected, it must be fixed by a programmer: A lock was created but not released at:
/var/www/html/moodle/admin/tool/task/cli/schedule_task.php on line 142
Code should look like:
$factory = \core\lock\lock_config::get_lock_factory('type');
$lock = $factory->get_lock(Resource id #656);
$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
Also we are running this task from the command-line but if we try to run it from within the browser (Scheduled Task -> Run Now) it is not completing and just fails/stops mid process so we never get to see a log.
As far as we are aware this has been ruining successfully with no errors for months, only i the last week has it failed.
Any help/thoughts, from anyone, would be very appreciated.
Thanks.