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

Database error when deleting users

    XMLWordPrintable

Details

    • MOODLE_31_STABLE

    Description

      We tried to delete all users except site admins on Moodle but it threw out some database error. We tried deleting them through bulk users action and upload users via csv with deleted=1, neither of them worked. Here is the stack trace:

      Debug info: SELECT id,category FROM

      {course}

      WHERE id IS NULL
      [array (
      )]
      Error code: invalidrecord
      ×Stack trace:
      line 1502 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
      line 1478 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
      line 6952 of /lib/accesslib.php: call to moodle_database->get_record()
      line 70 of /lib/classes/event/grade_deleted.php: call to context_course::instance()
      line 1036 of /lib/grade/grade_grade.php: call to core\event\grade_deleted::create_from_grade()
      line 1484 of /lib/gradelib.php: call to grade_grade->delete()
      line 3951 of /lib/moodlelib.php: call to grade_user_delete()
      line 30 of /admin/user/user_bulk_delete.php: call to delete_user()

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              shatami Pingtao Ye
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: