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

Error restoring a Moodle 1.9.x course to Moodle 2.x due to long filenames

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.3, 2.4.5, 2.5.1
    • 2.4.6, 2.5.2
    • Backup
    • MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • MOODLE_24_STABLE, MOODLE_25_STABLE
    • MDL-36126_master
    • Hide

      For master: Do the following on an upgraded site and a fresh install.

      1. Log in as an administrator.
      2. Visit a course.
      3. Click on 'Restore' under 'Course administration'.
      4. Restore the attached file and ensure there are no errors.
      5. Give yourself a pat on the back.
      Show
      For master: Do the following on an upgraded site and a fresh install. Log in as an administrator. Visit a course. Click on 'Restore' under 'Course administration'. Restore the attached file and ensure there are no errors. Give yourself a pat on the back.
    • 13
    • BACKEND Sprint 4

    Description

      While restoring a Moodle 1.9.x course to Moodle 2.3,
      I got the following error:

       
      Debug info: Data too long for column 'message' at row 1
      INSERT INTO mdl_backup_logs (backupid,timecreated,loglevel,message) VALUES(?,?,?,?)
      [array (
      0 => 'b783c62066f0733c5aa46099d97fac06',
      1 => 1350576667,
      2 => 30,
      3 => '(moodle1) error migrating file course_files/%D7%94%D7%A4%D7%95%D7%98%D7%A0%D7%A6%D7%99%D7%90%D7%9C_%D7%9C%D7%94%D7%A0%D7%94%D7%99%D7%92_%D7%94%D7%94%D7%91%D7%93%D7%9C%D7%99%D7%9D_%D7%91%D7%99%D7%9F_%D7%9E%D7%A0%D7%94%D7%99%D7%92%D7%99%D7%9D_%D7%9C%D7%9C%D7%90_%D7%9E%D7%A0%D7%94%D7%99%D7%92%D7%99%D7%9D.doc',
      )]
      Error code: dmlwriteexception
      Stack trace:
      line 410 of /lib/dml/moodle_database.php: dml_write_exception thrown
      line 948 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 990 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
      line 72 of /backup/util/loggers/database_logger.class.php: call to mysqli_native_moodle_database->insert_record()
      line 63 of /backup/util/loggers/database_logger.class.php: call to database_logger->insert_log_record()
      line 94 of /backup/util/loggers/base_logger.class.php: call to database_logger->action()
      line 100 of /backup/util/loggers/base_logger.class.php: call to base_logger->process()
      line 100 of /backup/util/loggers/base_logger.class.php: call to base_logger->process()
      line 100 of /backup/util/loggers/base_logger.class.php: call to base_logger->process()
      line 168 of /backup/util/helper/backup_helper.class.php: call to base_logger->process()
      line 96 of /backup/converter/convertlib.php: call to backup_helper::log()
      line 80 of /backup/converter/moodle1/lib.php: call to base_converter->log()
      line 1331 of /backup/converter/moodle1/lib.php: call to moodle1_converter->log()
      line 609 of /backup/converter/moodle1/lib.php: call to moodle1_file_manager->log()
      line 81 of /mod/label/backup/moodle1/lib.php: call to moodle1_converter::migrate_referenced_files()
      line 299 of /backup/converter/moodle1/lib.php: call to moodle1_mod_label_handler->process_label()
      line 737 of /backup/converter/moodle1/lib.php: call to moodle1_converter->process_chunk()
      line 125 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to moodle1_parser_processor->dispatch_chunk()
      line 148 of /backup/util/xml/parser/processors/simplified_parser_processor.class.php: call to grouped_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 150 of /backup/converter/moodle1/lib.php: call to progressive_parser->process()
      line 129 of /backup/converter/convertlib.php: call to moodle1_converter->execute()
      line 209 of /backup/util/helper/convert_helper.class.php: call to base_converter->convert()
      line 421 of /backup/controller/restore_controller.class.php: call to convert_helper::to_moodle2_format()
      line 35 of /backup/restore.php: call to restore_controller->convert()

      decoding the filename

      %D7%94%D7%A4%D7%95%D7%98%D7%A0%D7%A6%D7%99%D7%90%D7%9C_%D7%9C%D7%94%D7%A0%D7%94%D7%99%D7%92_%D7%94%D7%94%D7%91%D7%93%D7%9C%D7%99%D7%9D_%D7%91%D7%99%D7%9F_%D7%9E%D7%A0%D7%94%D7%99%D7%92%D7%99%D7%9D_%D7%9C%D7%9C%D7%90_%D7%9E%D7%A0%D7%94%D7%99%D7%92%D7%99%D7%9D

      using http://meyerweb.com/eric/tools/dencoder/
      I get the original Hebrew filename

      הפוטנציאל_להנהיג_ההבדלים_בין_מנהיגים_ללא_מנהיגים

      Since each single character in the Hebrew filename is tripled (decoded)...
      I suggest either to trim the filename variable that is sent to the insert sql statement or set the table field type to TEXT (and not VARCHAR(???) )

      Attachments

        Issue Links

          Activity

            People

              markn Mark Nelson
              nadavkav Nadav Kavalerchik
              Adrian Greeve Adrian Greeve
              Dan Poltawski Dan Poltawski
              Marina Glancy Marina Glancy
              Adrian Greeve, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                9/Sep/13