-
Bug
-
Resolution: Fixed
-
Critical
-
2.1
-
qa.moodle.net
-
MOODLE_21_STABLE
-
MOODLE_21_STABLE
-
MDL-28116-master -
-
During a QA test of backup and restore of grade categories and calculated grades, I struck a problem restoring a backup that included completion data.
During the final restore step the restore fails and the following error is reported.
Debug info: Duplicate entry '4-69' for key 'mdl_courmoducomp_usecou_uix'
|
INSERT INTO mdl_course_modules_completion (userid,completionstate,viewed,timemodified,coursemoduleid) VALUES(?,?,?,?,?)
|
[array (
|
0 => '4',
|
1 => '1',
|
2 => '0',
|
3 => 1309411185,
|
4 => 69,
|
)]
|
Stack trace:
|
line 396 of /lib/dml/moodle_database.php: dml_write_exception thrown
|
line 878 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
|
line 920 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
|
line 2238 of /backup/moodle2/restore_stepslib.php: call to mysqli_native_moodle_database->insert_record()
|
line 131 of /backup/util/plan/restore_structure_step.class.php: call to restore_userscompletion_structure_step->process_completion()
|
line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
|
line 125 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 169 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser_processor->receive_chunk()
|
line 253 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish()
|
line ? of unknownfile: call to progressive_parser->end_tag()
|
line 158 of /backup/util/xml/parser/progressive_parser.class.php: call to xml_parse()
|
line 137 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->parse()
|
line 105 of /backup/util/plan/restore_structure_step.class.php: call to progressive_parser->process()
|
line 153 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute()
|
line 179 of /backup/moodle2/restore_activity_task.class.php: call to base_task->execute()
|
line 148 of /backup/util/plan/base_plan.class.php: call to restore_activity_task->execute()
|
line 157 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
|
line 302 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
|
line 144 of /backup/util/ui/restore_ui.class.php: call to restore_controller->execute_plan()
|
line 45 of /backup/restore.php: call to restore_ui->execute()
|
Replication instructions:
- Create a backup which includes completion data (or use the attached backup)
- On the Settings, expand Course administration and click Restore
- Check that setting to restore as a new course and, pick a category and click Next
- Proceed through the steps with the default options
The restore failed at the last step (step 6).
If, when replicating this on another site (other than qa.moodle.net), the restore succeeds, repeat the restore process a second time. It looks like the conflict comes about with duplicates in the course completion table.
- has a non-specific relationship to
-
MDL-27988 ID Number activities into the calculated grade items are not restored in a full course restore
- Closed
-
MDL-46651 Restore fails with "Error writing to database Duplicate entry for key 'mdl_courcomp_usecou_uix'"
- Closed
- is duplicated by
-
MDL-30466 error while writing to database while restoring a backed up course that uses course completion
- Closed
- will help resolve
-
MDLQA-1110 CLONE - Gradebook restore works
- Passed