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

dml_missing_record_exception when sending assignment due/overdue notifications

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.5.3
    • Assignment

      When the assignment gets deleted between the creation of the ad-hoc task mod_assign\task\send_assignment_due_soon_notification_to_user and its execution, the ad-hoc task fails with a dml_missing_record_exception and the task gets stuck.

      Execute adhoc task: mod_assign\task\send_assignment_due_soon_notification_to_user
      Adhoc task id: 55870127
      Adhoc task custom data: {"assignmentid":"263963","userid":207977}
      ... started 11:20:21. Current memory use 3.6 MB.
      Debugging increased temporarily due to faildelay of 60
      ... used 2 dbqueries
      ... used 0.39715600013733 seconds
      Adhoc task failed: mod_assign\task\send_assignment_due_soon_notification_to_user, Can't find data record in database. (
                          SELECT c.*
                            FROM {assign} instance
                            JOIN {course} c ON c.id = instance.course
                           WHERE instance.id = ?
      [array (
        0 => 263963,
      )])
      Debug info:
       
                          SELECT c.*
                            FROM {assign} instance
                            JOIN {course} c ON c.id = instance.course
                           WHERE instance.id = ?
      [array (
        0 => 263963,
      )]
      Backtrace:
      * line 2947 of /lib/modinfolib.php: call to moodle_database->get_record_sql()
      * line 644 of /mod/assign/classes/notification_helper.php: call to get_course_and_cm_from_instance()
      * line 321 of /mod/assign/classes/notification_helper.php: call to mod_assign\notification_helper::get_assignment_data()
      * line 37 of /mod/assign/classes/task/send_assignment_due_soon_notification_to_user.php: call to mod_assign\notification_helper::send_due_soon_notification_to_user()
      * line 519 of /lib/classes/cron.php: call to mod_assign\task\send_assignment_due_soon_notification_to_user->execute()
      * line 348 of /lib/classes/cron.php: call to core\cron::run_inner_adhoc_task()
      * line 371 of /lib/classes/cron.php: call to core\cron::run_adhoc_task()
      * line 154 of /admin/cli/adhoc_task.php: call to core\cron::run_failed_adhoc_tasks()

       

      This also applies to the ad-hoc task mod_assign\task\send_assignment_overdue_notification_to_user.

            Daniel Ziegenberg Daniel Ziegenberg
            Daniel Ziegenberg Daniel Ziegenberg
            Andrew Gosali Andrew Gosali
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 19 minutes
                3h 19m

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