Cannot restore course - fails on quizzes Moodle 2.7.4

Cannot restore course - fails on quizzes Moodle 2.7.4

by Dwight Hawley -
Number of replies: 2

Trying to restore courses, we get "Error writing to database" Debug led me to the backup forum. They sent me to /health report which reported below and then suggested I ask here about insight on how to handle the non-zero category names./contexts. I am a total newbie in this area:


Question categories should belong to a valid context

All question categories are linked to a context id, and, the context they are linked to must exist. The following categories belong to a non-existant category:

Cat idCategory nameContext idNum Questions
87Default for Week 1 Quiz223222
166Default for Week 4 Quiz329420
408Default for Module 7 Quiz663210
546Default for Module 4 Quiz 1-Supine to Sit87055
554Default for Module 4 Quiz 1-Supine to Sit87085
407Default for Module 6 Quiz66285
104Default for 2nd trial quiz23920
222Default for Exam 140810
262Default for Final exam48130
404Default for Module 2 Quiz66100
405Default for Module 3 Quiz66160
406Default for Module 4 Quiz66200
547Default for Module 4 Quiz 1-Supine to Sit87060
403Default for Module 5 Quiz66240
237Default for Module 6 Quiz42530
244Default for Neuro Screening - Exam 244900
221Default for Outcome Measures Post-test40420
234Default for Outcome Measures Pre-test42050
254Default for Pressure Ulcer Module and Quiz35370
288Default for Quiz54120
402Default for Quiz66370
412Default for Quiz37540
263Default for Quiz over NRS material48440
424Default for Quiz template 166910
425Default for Quiz template 166920
261Default for Quiz Week 348120
170Default for Replacement Quiz 332790
272Default for test quiz50460
283Default for test quiz52850
102Default for Trial quiz23900
105Default for Trial Quiz 224020
154Default for Week 1 Quiz31050
162Default for Week 1 Quiz32520
179Default for Week 1 Quiz34650
266Default for Week 2 Quiz36180
111Default for Week 2 Quiz25260
156Default for Week 2 Quiz31330
164Default for Week 2 Quiz32640
355Default for Week 3 Quiz41180
113Default for Week 3 Quiz24930
158Default for Week 3 Quiz31550
165Default for Week 3 Quiz32770
159Default for Week 4 Quiz31800
114Default for Week 5 Quiz25920
160Default for Week 5 Quiz31970
167Default for Week 5 Quiz33090
172Default for Week 6 - Brainstem & Cranial Nerves33230
69Default for Week 6 Quiz17560
115Default for Week 6 Quiz26150
157Default for Week 6 Quiz32190
235Outcome Measures Post-Test42050

Any of these categories that contain no questions can just be deleted form the database. Other categories will require more thought.

DEBUG:

Debug info: Duplicate entry '6467' for key 'mdl_qtypmultopti_que_uix'
INSERT INTO mdl_qtype_multichoice_options (layout,single,shuffleanswers,correctfeedback,correctfeedbackformat,partiallycorrectfeedback,partiallycorrectfeedbackformat,incorrectfeedback,incorrectfeedbackformat,answernumbering,shownumcorrect,questionid) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)
[array (
0 => '0',
1 => '1',
2 => '1',
3 => '',
4 => '1',
5 => '',
6 => '1',
7 => '',
8 => '1',
9 => 'abc',
10 => '0',
11 => 6467,
)]
Error code: dmlwriteexception

Stack trace:

  • line 446 of /lib/dml/moodle_database.php: dml_write_exception thrown
  • line 1164 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1210 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
  • line 76 of /question/type/multichoice/backup/moodle2/restore_qtype_multichoice_plugin.class.php: call to mysqli_native_moodle_database->insert_record()
  • line 137 of /backup/util/plan/restore_structure_step.class.php: call to restore_qtype_multichoice_plugin->process_multichoice()
  • line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
  • line 151 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk()
  • line 91 of /backup/util/helper/restore_structure_parser_processor.class.php: call to grouped_parser_processor->postprocess_chunk()
  • line 148 of /backup/util/xml/parser/processors/simplified_parser_processor.class.php: call to restore_structure_parser_processor->postprocess_chunk()
  • line 92 of /backup/util/xml/parser/processors/progressive_parser_processor.class.php: call to simplified_parser_processor->process_chunk()
  • line 190 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser_processor->receive_chunk()
  • line 278 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish()
  • line ? of unknownfile: call to progressive_parser->end_tag()
  • line 179 of /backup/util/xml/parser/progressive_parser.class.php: call to xml_parse()
  • line 158 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->parse()
  • line 110 of /backup/util/plan/restore_structure_step.class.php: call to progressive_parser->process()
  • line 181 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute()
  • line 177 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
  • line 167 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
  • line 333 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
  • line 184 of /backup/util/ui/restore_ui.class.php: call to restore_controller->execute_plan()
line 111 of /backup/restore.php: call to restore_ui->execute()
Average of ratings: -
In reply to Dwight Hawley

Re: Cannot restore course - fails on quizzes Moodle 2.7.4

by Dwight Hawley -

Against all my wisdom, having just increased Max_Packets last month, we increased it to 1,024MB and restore ran flawlessly. So the emergency is gone, but I still have the "lost" categories noted above and would like to sort that out correctly.


--Dwight

In reply to Dwight Hawley

Re: Cannot restore course - fails on quizzes Moodle 2.7.4

by Dwight Hawley -

Sadly back again. After getting one restore it thre error again. Increased Max_Packets to 2,048 and got another restore but now same error again. Now SYSADMIN says there are server issues with stability if we go any higher. Should we need to go higher or is this not truly the issue?


Any thoughts?