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

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

XMLWordPrintable

    • MOODLE_38_STABLE
    • master_MDL-68057
    • Hide

      This is quite hard to test, it involves trying to get prediction data and then un-enrolling a user from a course at the correct time during the task - after the data has been generated and before the machine learning returns a prediction.

      It might be best for a developer to verify that the code makes sense.

      Show
      This is quite hard to test, it involves trying to get prediction data and then un-enrolling a user from a course at the correct time during the task - after the data has been generated and before the machine learning returns a prediction. It might be best for a developer to verify that the code makes sense.

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

            Unassigned Unassigned
            danmarsden Dan Marsden
            Simey Lameze Simey Lameze
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:

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

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.