by Geant IT.
See below in task list:
Execute adhoc task: core_course\task\course_delete_modules ... started 20:56:21. Current memory use 33.3MB. ... used 52 dbqueries ... used 1.2046020030975 seconds Adhoc task failed: core_course\task\course_delete_modules,Coding error detected, it must be fixed by a programmer: The course module 2396 could not be deleted. #0 /var/www/moodle/lib/dml/mysqli_native_moodle_database.php(1273): moodle_database->query_end(false) #1 /var/www/moodle/lib/dml/moodle_database.php(1453): mysqli_native_moodle_database->get_records_sql('SELECT * FROM m...', Array, 0, 0) #2 /var/www/moodle/lib/dml/moodle_database.php(1404): moodle_database->get_records_select('backup_ids_temp', 'WHERE backupid ...', Array, '', '*', 0, 0) #3 /var/www/moodle/backup/moodle2/backup_stepslib.php(2196): moodle_database->get_records('backup_ids_temp', Array) #4 /var/www/moodle/backup/util/plan/backup_execution_step.class.php(34): backup_annotate_groups_from_groupings->define_execution() #5 /var/www/moodle/backup/util/plan/base_task.class.php(181): backup_execution_step->execute() #6 /var/www/moodle/backup/moodle2/backup_activity_task.class.php(222): base_task->execute() #7 /var/www/moodle/backup/util/plan/base_plan.class.php(178): backup_activity_task->execute() #8 /var/www/moodle/backup/util/plan/backup_plan.class.php(145): base_plan->execute() #9 /var/www/moodle/backup/controller/backup_controller.class.php(410): backup_plan->execute() #10 /var/www/moodle/admin/tool/recyclebin/classes/course_bin.php(136): backup_controller->execute_plan() #11 /var/www/moodle/admin/tool/recyclebin/lib.php(151): tool_recyclebin\course_bin->store_item(Object(stdClass)) #12 /var/www/moodle/course/lib.php(1046): tool_recyclebin_pre_course_module_delete(Object(stdClass)) #13 /var/www/moodle/course/classes/task/course_delete_modules.php(66): course_delete_module('2396') #14 /var/www/moodle/lib/cronlib.php(333): core_course\task\course_delete_modules->execute() #15 /var/www/moodle/lib/cronlib.php(198): cron_run_inner_adhoc_task(Object(core_course\task\course_delete_modules)) #16 /var/www/moodle/lib/cronlib.php(76): cron_run_adhoc_tasks(1643313361) #17 /var/www/moodle/admin/cli/cron.php(79): cron_run() #18 {main} Backtrace: * line 333 of /lib/cronlib.php: call to core_course\task\course_delete_modules->execute() * line 198 of /lib/cronlib.php: call to cron_run_inner_adhoc_task() * line 76 of /lib/cronlib.php: call to cron_run_adhoc_tasks() * line 79 of /admin/cli/cron.php: call to cron_run()
Course copy is throwing a dml exception claiming mdl_backup_ids_temp does not exist, but user has ALL permissions in DB and I can created it using the same creds on the command line connection to the DB host
cli backup also fails with the below:
s:1526:"Stack trace: * line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown * line 1212 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() * line 1955 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_recordset_sql() * line 1940 of /lib/dml/moodle_database.php: call to moodle_database->record_exists_sql() * line 1924 of /lib/dml/moodle_database.php: call to moodle_database->record_exists_select() * line 103 of /backup/util/dbops/backup_structure_dbops.class.php: call to moodle_database->record_exists() * line 144 of /backup/util/dbops/backup_structure_dbops.class.php: call to backup_structure_dbops::insert_backup_ids_record() * line 89 of /backup/util/structure/backup_structure_processor.class.php: call to backup_structure_dbops::annotate_files() * line 93 of /backup/util/structure/backup_nested_element.class.php: call to backup_structure_processor->process_nested_element() * line 97 of /backup/util/plan/backup_structure_step.class.php: call to backup_nested_element->process() * line 181 of /backup/util/plan/base_task.class.php: call to backup_structure_step->execute() * line 178 of /backup/util/plan/base_plan.class.php: call to base_task->execute() * line 145 of /backup/util/plan/backup_plan.class.php: call to base_plan->execute() * line 410 of /backup/controller/backup_controller.class.php: call to backup_plan->execute() * line 100 of /admin/cli/backup.php: call to backup_controller->execute_plan()
php backup.php --courseid=147 --courseshortname=OAVProdIntro PHP Warning: Module 'mcrypt' already loaded in Unknown on line 0 PHP Warning: Module 'zip' already loaded in Unknown on line 0 == Performing backup... == instantiating backup controller 769ec7775a664abd23ae58e2c2e6d245 setting controller status to 100 loading controller plan setting controller status to 300 applying plan defaults setting controller status to 400 setting file inclusion to checking plan security setting controller status to 500 setting controller status to 700 saving controller to db calculating controller checksum 6d84e3da48aa3373832771bbb8d5e84c loading controller from db setting file inclusion to 1 setting controller status to 800 saving controller to db calculating controller checksum 9f6bf69e77b437058fcb7bac260ed7af loading controller from db Default exception handler: Error reading from database Debug: Table 'moodle_production.mdl_backup_ids_temp' doesn't exist SELECT 'x' FROM mdl_backup_ids_temp WHERE backupid = ? AND itemname = ? AND itemid = ? LIMIT 0, 1 [array ( 0 => '769ec7775a664abd23ae58e2c2e6d245', 1 => 'file', 2 => '75528', )] Error code: dmlreadexception * line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown * line 1212 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() * line 1955 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_recordset_sql() * line 1940 of /lib/dml/moodle_database.php: call to moodle_database->record_exists_sql() * line 1924 of /lib/dml/moodle_database.php: call to moodle_database->record_exists_select() * line 103 of /backup/util/dbops/backup_structure_dbops.class.php: call to moodle_database->record_exists() * line 144 of /backup/util/dbops/backup_structure_dbops.class.php: call to backup_structure_dbops::insert_backup_ids_record() * line 89 of /backup/util/structure/backup_structure_processor.class.php: call to backup_structure_dbops::annotate_files() * line 93 of /backup/util/structure/backup_nested_element.class.php: call to backup_structure_processor->process_nested_element() * line 97 of /backup/util/plan/backup_structure_step.class.php: call to backup_nested_element->process() * line 181 of /backup/util/plan/base_task.class.php: call to backup_structure_step->execute() * line 178 of /backup/util/plan/base_plan.class.php: call to base_task->execute() * line 145 of /backup/util/plan/backup_plan.class.php: call to base_plan->execute() * line 410 of /backup/controller/backup_controller.class.php: call to backup_plan->execute() * line 100 of /admin/cli/backup.php: call to backup_controller->execute_plan() !!! Error reading from database !!! !! Table 'moodle_production.mdl_backup_ids_temp' doesn't exist SELECT 'x' FROM mdl_backup_ids_temp WHERE backupid = ? AND itemname = ? AND itemid = ? LIMIT 0, 1 [array ( 0 => '769ec7775a664abd23ae58e2c2e6d245', 1 => 'file', 2 => '75528', )] Error code: dmlreadexception !! !! Stack trace: * line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown * line 1212 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() * line 1955 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_recordset_sql() * line 1940 of /lib/dml/moodle_database.php: call to moodle_database->record_exists_sql() * line 1924 of /lib/dml/moodle_database.php: call to moodle_database->record_exists_select() * line 103 of /backup/util/dbops/backup_structure_dbops.class.php: call to moodle_database->record_exists() * line 144 of /backup/util/dbops/backup_structure_dbops.class.php: call to backup_structure_dbops::insert_backup_ids_record() * line 89 of /backup/util/structure/backup_structure_processor.class.php: call to backup_structure_dbops::annotate_files() * line 93 of /backup/util/structure/backup_nested_element.class.php: call to backup_structure_processor->process_nested_element() * line 97 of /backup/util/plan/backup_structure_step.class.php: call to backup_nested_element->process() * line 181 of /backup/util/plan/base_task.class.php: call to backup_structure_step->execute() * line 178 of /backup/util/plan/base_plan.class.php: call to base_task->execute() * line 145 of /backup/util/plan/backup_plan.class.php: call to base_plan->execute() * line 410 of /backup/controller/backup_controller.class.php: call to backup_plan->execute() * line 100 of /admin/cli/backup.php: call to backup_controller->execute_plan() !! Potential coding error - existing temptables found when disposing database. Must be dropped!
I have trawled through many semi related topics but cannot find anything that helps. PHP params for max_execution and size have been tweaked and still nothing.
Looking for some direction to look next
Not sure if this is related but I do have some odd characters in a filename from the below SQL: select timecreated,timemodified,userid,contenthash,filearea,filename,filesize from `mdl_files` where filename like "%.mbz%" order by timecreated DESC; +-------------+--------------+--------+------------------------------------------+----------+-------------------------------------------------------------------------------+-----------+ | timecreated | timemodified | userid | contenthash | filearea | filename | filesize | +-------------+--------------+--------+------------------------------------------+----------+-------------------------------------------------------------------------------+-----------+ | 1643201505 | 1643201505 | 293 | 353deed66b0122655435d6f4b3127316e9d31595 | draft | бекап-moodle2-course-2572-тест_е-маил-26012022-1351-nu-nf.mbz | 3759 | | 1643192682 | 1643192682 | 317 | 282c32dd96ebfcb995440a0faa07a973f98b6cae | draft | backup-moodle2-course-185-testav-20220126-1053.mbz | 3496 | | 1643191173 | 1643191173 | 317 | 282c32dd96ebfcb995440a0faa07a973f98b6cae | draft | backup-moodle2-course-185-testav-20220126-1053.mbz | 3496
Any help appreciated.
Course copy works on out UAT instance, just not in prod. Both are puppet built so no clues there either.