-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
3.8.1
When the predict models task runs it collects data about users and then sends it to the machine learning back-end - sometimes that process can take a significant amount of time. If the user is removed from a course during that time it causes the prediction process to generate a fatal error, and on each subsequent run of the predict models process it tries to send the data it sent previously and so each time gets an error.
When processing the predictions returned from the machine learning, the code should check if the context associated with the prediction still exists and if it doesn't, it should ignore the prediction.
— full error —
Scheduled task failed: Predict models (tool_analytics\task\predict_models),Can't find data record in database table course.
Debug info:
SELECT id,category FROM {course} WHERE id IS NULL
[array (
)]
Backtrace:
• line 1538 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
• line 6827 of /lib/accesslib.php: call to moodle_database->get_record()
• line 63 of /lib/classes/analytics/analyser/student_enrolments.php: call to context_course::instance()
• line 1107 of /analytics/classes/model.php: call to core\analytics\analyser\student_enrolments->sample_access_context()
• line 935 of /analytics/classes/model.php: call to core_analytics\model->prepare_prediction_record()
• line 851 of /analytics/classes/model.php: call to core_analytics\model->execute_prediction_callbacks()
• line 70 of /admin/tool/analytics/classes/task/predict_models.php: call to core_analytics\model->predict()
• line 157 of /admin/tool/task/cli/schedule_task.php: call to tool_analytics\task\predict_models->execute()