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

Restoring a course fails at mdl_log insert

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      On master and 2.7

      Ensure the legacy store is enabled, to do this.

      1. Visit 'Site administration' -> 'Plugins' -> 'Logging' -> 'Manage log stores'.
      2. Enable 'Legacy log' and disable the rest.
      3. Click on the settings next to 'Legacy log' and ensure 'Log legacy data' is checked.
      The test
      1. Create a new site (we need the course ids to be single digits).
      2. Create 9 courses - enrol a student in one of the courses.
      3. Create a forum in any of the courses.
      4. Log in as a student and click on this forum.
      5. In the search bar search for "averylongrandomstringusedsolelyfortestingamoodleissuewhererestoringacoursefailsebecausetheurlistoolongithinkihavereachedthelimit".
      6. As an administrator visit the course you performed the forum search in and create a backup (ensure you include the course logs - it is necessary that the search was done by someone else other than the admin or the logs are not included).
      7. Check that you can restore this backup (ensure you include the course logs) into a new course - you will get a debugging message in 2.6 about a long URL being inserted if you have debug developer on.
      Show
      On master and 2.7 Ensure the legacy store is enabled, to do this. Visit 'Site administration' -> 'Plugins' -> 'Logging' -> 'Manage log stores'. Enable 'Legacy log' and disable the rest. Click on the settings next to 'Legacy log' and ensure 'Log legacy data' is checked. The test Create a new site (we need the course ids to be single digits). Create 9 courses - enrol a student in one of the courses. Create a forum in any of the courses. Log in as a student and click on this forum. In the search bar search for "averylongrandomstringusedsolelyfortestingamoodleissuewhererestoringacoursefailsebecausetheurlistoolongithinkihavereachedthelimit". As an administrator visit the course you performed the forum search in and create a backup (ensure you include the course logs - it is necessary that the search was done by someone else other than the admin or the logs are not included). Check that you can restore this backup (ensure you include the course logs) into a new course - you will get a debugging message in 2.6 about a long URL being inserted if you have debug developer on.
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull Master Branch:
      MDL-34248_master
    • Story Points:
      13
    • Sprint:
      BACKEND Sprint 14

      Description

      When i tried to restore a course in a new course, the following message occured (log files):

      Default exception handler: \xce\xa3\xcf\x86\xce\xac\xce\xbb\xce\xbc\xce\xb1 \xce\xb5\xce\xb3\xce\xb3\xcf\x81\xce\xb1\xcf\x86\xce\xae\xcf\x82 \xcf\x83\xcf\x84\xce\xb7 \xce\xb2\xce\xac\xcf\x83\xce\xb7 \xce\xb4\xce\xb5\xce\xb4\xce\xbf\xce\xbc\xce\xad\xce\xbd\xcf\x89\xce\xbd Debug: Data too long for column 'url' at row 1
      INSERT INTO mdl_log (time,userid,ip,module,action,url,info,course,cmid) VALUES(?,?,?,?,?,?,?,?,?)
      [array (
        0 => 1321027807,
        1 => '79',
        2 => '10.10.10.1',
        3 => 'forum',
        4 => 'search',
        5 => 'search.php?id=123&search=%CE%99%CF%...',
        6 => '\xce\x99\xcf\x83\xcf\x84\xce\xbf\xcf\x81\xce\xaf\xce\xb1 \xce\x95\xce\xbb\xce\xbb\xce\xb7\xce\xbd\xce\xb9\xce\xba\xce\xbf\xcf\x8d \xce\x95\xce\xb8\xce\xbd\xce\xbf\xcf\x85\xcf\x82',
        7 => 123,
        8 => 0,
      )]
      * line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
      * line 893 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      * line 935 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
      * line 1974 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_course_logs_structure_step->process_log()
      * 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 148 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()
      , referer: http://server_url/backup/restore.php
      [Tue Jul 10 13:15:51 2012] [error] [client xxx.xxx.xxx.xxx] Potential coding error - existing temptables found when disposing database. Must be dropped!, referer: http://server url/backup/restore.php
      

        Attachments

          Activity

            People

            Assignee:
            markn Mark Nelson
            Reporter:
            chrodos Christos Rodosthenous
            Peer reviewer:
            Andrew Davis
            Integrator:
            Dan Poltawski
            Tester:
            John Okely
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              8/Sep/14