Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-33455

Error while restoring backup into a new course

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.6, 2.2.3, 2.3
    • 2.1.7, 2.2.4
    • Backup, Gradebook
    • MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • MOODLE_21_STABLE, MOODLE_22_STABLE
    • wip-mdl-33455
    • Hide
      1. Log in as admin
      2. restore attached course backup (backup-moodle2-course-itc1-20120531-2114-modified.mbz) in new course
      3. Make sure you don't encounter any error and course should restore.(Note: you will get debug notice like "Mapped user id not found for grade item id '54'")
      4. 2 users are shown as participants ("sam student" and "teacher tom").
      Show
      Log in as admin restore attached course backup (backup-moodle2-course-itc1-20120531-2114-modified.mbz) in new course Make sure you don't encounter any error and course should restore.(Note: you will get debug notice like "Mapped user id not found for grade item id '54'") 2 users are shown as participants ("sam student" and "teacher tom").

    Description

      Got the following error while restoring a backup into a new course. lol @ "Will be implemented before 2.0 release"

      Error writing to database

      More information about this error
      Debug info: Column 'userid' cannot be null
      INSERT INTO mdl_grade_grades (userid,rawgrade,rawgrademax,rawgrademin,rawscaleid,usermodified,finalgrade,hidden,locked,locktime,exported,overridden,excluded,feedback,feedbackformat,information,informationformat,timecreated,timemodified,itemid) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
      [array (
      0 => NULL,
      1 => NULL,
      2 => '100.00000',
      3 => '0.00000',
      4 => NULL,
      5 => NULL,
      6 => NULL,
      7 => '0',
      8 => '0',
      9 => '0',
      10 => '0',
      11 => '0',
      12 => '0',
      13 => NULL,
      14 => '0',
      15 => NULL,
      16 => '0',
      17 => NULL,
      18 => NULL,
      19 => '17',
      )]
      Error code: dmlwriteexception
      Stack trace:

      line 416 of /lib/dml/moodle_database.php: dml_write_exception thrown
      line 952 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 994 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
      line 222 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_gradebook_structure_step->process_grade_grade()
      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 146 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
      line 157 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
      line 315 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
      line 147 of /backup/util/ui/restore_ui.class.php: call to restore_controller->execute_plan()
      line 46 of /backup/restore.php: call to restore_ui->execute()

      Output buffer: <div class="notifytiny">Skipping 'database' enrolment plugin. Will be implemented before 2.0 release<ul style="text-align: left"><li>line 1496 of /backup/moodle2/restore_stepslib.php: call to debugging()</li><li>line 131 of /backup/util/plan/restore_structure_step.class.php: call to restore_enrolments_structure_step->process_enrol()</li><li>line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()</li><li>line 125 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk()</li><li>line 91 of /backup/util/helper/restore_structure_parser_processor.class.php: call to grouped_parser_processor->postprocess_chunk()</li><li>line 148 of /backup/util/xml/parser/processors/simplified_parser_processor.class.php: call to restore_structure_parser_processor->postprocess_chunk()</li><li>line 92 of /backup/util/xml/parser/processors/progressive_parser_processor.class.php: call to simplified_parser_processor->process_chunk()</li><li>line 169 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser_processor->receive_chunk()</li><li>line 253 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish()</li><li>line ? of unknownfile: call to progressive_parser->end_tag()</li><li>line 158 of /backup/util/xml/parser/progressive_parser.class.php: call to xml_parse()</li><li>line 137 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->parse()</li><li>line 105 of /backup/util/plan/restore_structure_step.class.php: call to progressive_parser->process()</li><li>line 153 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute()</li><li>line 146 of /backup/util/plan/base_plan.class.php: call to base_task->execute()</li><li>line 157 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()</li><li>line 315 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()</li><li>line 147 of /backup/util/ui/restore_ui.class.php: call to restore_controller->execute_plan()</li><li>line 46 of /backup/restore.php: call to restore_ui->execute()</li></ul></div>

      Attachments

        Issue Links

          Activity

            People

              rajeshtaneja Rajesh Taneja
              andyjdavis Andrew Davis
              Andrew Davis Andrew Davis
              Aparup Banerjee Aparup Banerjee
              Aparup Banerjee Aparup Banerjee
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Jul/12