cron.php - Database transaction aborted automatically AT quiz_cron

cron.php - Database transaction aborted automatically AT quiz_cron

by Jesus Vte. Vila -
Number of replies: 1

Hi, I'm running Moodle 3.5.13+ bajo Linux + MySQL

I've been noticing that the cron.php work is not over.

If I launch it by hand with the command: sudo -u www-data / usr / bin / php /var/www/html/moodle/admin/cli/cron.php

I got the following error:

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

Starting activity modules

Processing module function quiz_cron ...

Looking for quiz overdue quiz attempts...

PHP Notice:  Undefined offset: 2 in /var/www/html/moodle/question/type/gapselect/questionbase.php on line 130

Notice: Undefined offset: 2 in /var/www/html/moodle/question/type/gapselect/questionbase.php on line 130

Database transaction aborted automatically in /var/www/html/moodle/admin/cli/cron.php

Default exception handler: Excepción - Call to a member function summarise() on null Debug: 

Error code: generalexceptionmessage

* line 65 of /question/type/ddimageortext/questionbase.php: Error thrown

* line 113 of /question/behaviour/deferredfeedback/behaviour.php: call to qtype_ddtoimage_question_base->summarise_response()

* line 57 of /question/behaviour/deferredfeedback/behaviour.php: call to qbehaviour_deferredfeedback->process_finish()

* line 1279 of /question/engine/questionattempt.php: call to qbehaviour_deferredfeedback->process_action()

* line 1317 of /question/engine/questionattempt.php: call to question_attempt->process_action()

* line 840 of /question/engine/questionusage.php: call to question_attempt->finish()

* line 1968 of /mod/quiz/attemptlib.php: call to question_usage_by_activity->finish_all_questions()

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

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

* line 598 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 105 of /lib/cronlib.php: call to core\task\legacy_plugin_cron_task->execute()

* line 67 of /lib/cronlib.php: call to cron_run_inner_scheduled_task()

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

!!! Excepción - Call to a member function summarise() on null !!!

PHP Fatal error:  Uncaught coding_exception: Detectado un error de codificación, debe ser corregido por un programador: A lock was created but not released at:

/var/www/html/moodle/lib/classes/task/manager.php on line 520

 Code should look like:

 $factory = \core\lock\lock_config::get_lock_factory('type');

 $lock = $factory->get_lock(Resource id #699);

 $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

Fatal error: Uncaught coding_exception: Detectado un error de codificación, debe ser corregido por un programador: A lock was created but not released at:

/var/www/html/moodle/lib/classes/task/manager.php on line 520

 Code should look like:

 $factory = \core\lock\lock_config::get_lock_factory('type');

 $lock = $factory->get_lock(Resource id #699);

 $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

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

I've edited /var/www/html/moodle/mod/quiz/lib.php and commented all quiz_cron function, and now cron.php runs perfectly.

The call is making the exception is list($count, $quizcount) = $overduehander->update_overdue_attempts($timenow, $processto);

How can i fix this?

Thanks,

Average of ratings: -