can't bulk delete with 'Upload Users'

can't bulk delete with 'Upload Users'

by Otaku Dude -
Number of replies: 2

Hello all,

I'm trying to delete a large number of users via a csv and the Upload Users function. My csv just has  'username' and 'deleted' and loads fine. I set it to update existing users only and to allow deletes. When I action it I get the following error:

Debug info: SELECT id,category FROM {course} WHERE id IS NULL

[array (

)]

Error code: invalidrecord

Stack trace:

line 1599 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown

line 1575 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()

line 6928 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 1122 of /lib/grade/grade_grade.php: call to core\event\grade_deleted::create_from_grade()

line 1536 of /lib/gradelib.php: call to grade_grade->delete()

line 4242 of /lib/moodlelib.php: call to grade_user_delete()

line 422 of /admin/tool/uploaduser/index.php: call to delete_user()

Thank you,

Nige.

Average of ratings: -
In reply to Otaku Dude

Re: can't bulk delete with 'Upload Users'

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers
In reply to Leon Stringer

Re: can't bulk delete with 'Upload Users'

by Otaku Dude -
Oops! Good shout.

It's Moodle 3.9.1, upgraded in August 2020. The more info on this error suggests running cron a few times, which we have done.

Thank you,
Nige.