Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-68057

predict models fails and get stuck when it finds invalid/old records

    XMLWordPrintable

    Details

      Description

      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()

        Attachments

          Activity

            People

            Assignee:
            danmarsden Dan Marsden
            Reporter:
            danmarsden Dan Marsden
            Peer reviewer:
            Simey Lameze
            Participants:
            Component watchers:
            Elizabeth Dalton, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 12 minutes
                1h 12m