-
Bug
-
Resolution: Fixed
-
Minor
-
3.10.7, 3.11.3, 4.0
-
MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_400_STABLE
-
MOODLE_310_STABLE, MOODLE_311_STABLE
-
While working with a partner on a backup/restore issue, and after consulting with stronk7, we might try to make the question attempt restoration process a little more forgiving when restoring question attempts that appear to lack matching users:
[Tue Oct 05 11:58:44.273132 2021] [php7:notice] [pid 20] [client 172.19.0.1:47948] Default exception handler: Error writing to database Debug: Duplicate entry '1-0-1' for key 'm_quizatte_quiuseatt_uix'
|
INSERT INTO m_quiz_attempts (userid,uniqueid,layout,currentpage,preview,state,timestart,timefinish,timemodified,timemodifiedoffline,timecheckstate,sumgrades,quiz,attempt) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?)
|
[array (
|
0 => 0,
|
1 => 8,
|
2 => '1,0,2,0,3,0,4,0,5,0,6,0,7,0,8,0,9,0,10,0,11,0,12,0,13,0',
|
3 => '12',
|
4 => '0',
|
5 => 'finished',
|
6 => '1519300587',
|
7 => '1519300989',
|
8 => '1519300989',
|
9 => '0',
|
10 => 0,
|
11 => '12.33333',
|
12 => 1,
|
13 => '1',
|
)]
|
Error code: dmlwriteexception
|
* line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown
|
* line 1357 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
|
* line 1403 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
|
* line 495 of /mod/quiz/backup/moodle2/restore_quiz_stepslib.php: call to mysqli_native_moodle_database->insert_record()
|
* line 5649 of /backup/moodle2/restore_stepslib.php: call to restore_quiz_activity_structure_step->inform_new_usage_id()
|
* line 5611 of /backup/moodle2/restore_stepslib.php: call to restore_questions_activity_structure_step->restore_question_usage_worker()
|
* line 137 of /backup/util/plan/restore_structure_step.class.php: call to restore_questions_activity_structure_step->process_question_usage()
|
* line 121 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
|
* line 178 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk()
|
* line 109 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 237 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish()
|
* line ? of unknownfile: call to progressive_parser->start_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 219 of /backup/moodle2/restore_activity_task.class.php: call to base_task->execute()
|
* line 191 of /backup/util/plan/base_plan.class.php: call to restore_activity_task->execute()
|
* line 168 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
|
* line 394 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
|
* line 219 of /backup/util/ui/restore_ui.class.php: call to restore_controller->execute_plan()
|
* line 143 of /backup/restore.php: call to restore_ui->execute()
|
, referer: http://localhost:8000/backup/restore.php
|
This appears to be attempting to insert an attempt for user with ID=0, and when it tries to do that a second time, it hits the unique index constraint on the table
- Testing discovered
-
MDL-72950 Problem restoring question categories when source and target contexts match
- Closed