I'm going to try this again with way more info.
Moodle 3.5 on an under-powered dev system. I'm trying to upgrade our codebase from 3.1 to 3.5, we have a ton of plugins and we're trying to test everything. I've created a dev system with a copy of our database but there isn't a complete copy of all the files in the moodle files directory. We have a script that uses a snapshot from a few months ago so it's not quite a perfect match. We can still upload files and stuff. moodledata is there, it's just missing a bunch of newer stuff.
We have recyclebin installed and enabled.
We have a number of courses that show the warning "Warning: Activity deletion in progress! Some grades are about to be removed." at the top of the gradebook setup page and [Deletion in progress] next to some items. I have been told that cron should clean these up eventually. But it doesn't.
I have attempted running cron manually on the command line but cron fails all over the place in the adhoc tasks. For example, it tries to run core_course\task\course_delete_modules and barfs at deleting a lesson
Adhoc task failed: core_course\task\course_delete_modules,Coding error detected, it must be fixed by a programmer: The course module 1599741 could not be deleted. #0 /var/www/ssl/gs_35/lib/dml/moodle_database.php(1522): moodle_database->get_record_select('lesson', 'WHERE id = ?', Array, '*', 2) #1 /var/www/ssl/gs_35/mod/lesson/lib.php(355): moodle_database->get_record('lesson', Array, '*', 2) #2 /var/www/ssl/gs_35/course/lib.php(1194): lesson_delete_instance('2376') #3 /var/www/ssl/gs_35/course/classes/task/course_delete_modules.php(66): course_delete_module('1599741') #4 /var/www/ssl/gs_35/lib/cronlib.php(185): core_course\task\course_delete_modules->execute() #5 /var/www/ssl/gs_35/lib/cronlib.php(74): cron_run_inner_adhoc_task(Object(core_course\task\course_delete_modules)) #6 /var/www/ssl/gs_35/admin/cli/cron.php(61): cron_run() #7 {main}
I think that lesson got halfway deleted. The lesson is not in the mdl_lesson table. But the item is still in the mdl_course_modules table. It's not listed in the recycle bin. I tried fixing the lesson delete function so it wouldn't throw up an error but that didn't fix the original problem which is that there are multiple items in the gradebook that say [deletion in progress] and that warning message at the top. How do I fix this???
I am flailing around trying to figure out what is the problem. Is there a problem with cron? With recycle bin? With the lesson module? With there not being all the files on the filesystem? With memory on the system? If I knew where to look, maybe I could fix it or maybe I could say this is a problem only because of the dev system.
Please help with my problem. If you need a refresher, my problem is in bold above.