Moodle
  1. Moodle
  2. MDL-36126

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.3, 2.4.5, 2.5.1
    • Fix Version/s: 2.4.6, 2.5.2
    • Component/s: Backup
    • Labels:
    • Story Points:
      13
    • Rank:
      44895
    • Sprint:
      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(???) )

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          Thanks for reporting this.

          I've put that on the backlog.

          In the meantime feel free to help us work on this issue.

          Show
          Michael de Raadt added a comment - Thanks for reporting this. I've put that on the backlog. In the meantime feel free to help us work on this issue.
          Hide
          Nadav Kavalerchik added a comment -

          Just had another incident like the previous one. (It happens from time to time, rarely)
          This time I was lazy, instead of going through all the amazingly long Hebrew file names and trying to truncate them... I issued the following an SQL command on the Moodle DB:

          ALTER TABLE mdl_backup_logs CHANGE message message LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''
          

          Which worked around the issue

          Show
          Nadav Kavalerchik added a comment - Just had another incident like the previous one. (It happens from time to time, rarely) This time I was lazy, instead of going through all the amazingly long Hebrew file names and trying to truncate them... I issued the following an SQL command on the Moodle DB: ALTER TABLE mdl_backup_logs CHANGE message message LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' Which worked around the issue
          Hide
          Mark Nelson added a comment -

          Hi Nadav,

          I was not able to replicate this. Can you please provide a detailed step by step instruction on how to do this?

          What I did.

          1. Created a course in a 1.9 site and set the language to Hebrew.
          2. Created a label resource and added an image to the html editor, the name of the file I added was (copying from your description) הפוטנציאל_להנהיג_ההבדלים_בין_מנהיגים_ללא_מנהיגים.png
          3. Created a backup of this course.
          4. I was then able to successfully restore this in 2.3.

          If you could identify what steps I missed, or what I did wrong in an attempt to replicate this that would be great. Thanks for your help.

          Show
          Mark Nelson added a comment - Hi Nadav, I was not able to replicate this. Can you please provide a detailed step by step instruction on how to do this? What I did. Created a course in a 1.9 site and set the language to Hebrew. Created a label resource and added an image to the html editor, the name of the file I added was (copying from your description) הפוטנציאל_להנהיג_ההבדלים_בין_מנהיגים_ללא_מנהיגים.png Created a backup of this course. I was then able to successfully restore this in 2.3. If you could identify what steps I missed, or what I did wrong in an attempt to replicate this that would be great. Thanks for your help.
          Hide
          Nadav Kavalerchik added a comment -

          Hi Mark,

          Thank you for following up on this issue.
          What you did is exactly what I would have suggested you should do.
          Weird. That should invoked the issue.

          It was long time ago, and running a quick search I did not find the course, yet. When I find that specific course I will try to send it over, somehow.

          Since that incident, we are restoring a lot of courses and we did not have any more issues. But I guess it has to do with the SQL UPDATE to the table's structure. setting message field to LONGTEXT. If it is not causing any issues with Moodle code, please consider making that change in the DB.

          Show
          Nadav Kavalerchik added a comment - Hi Mark, Thank you for following up on this issue. What you did is exactly what I would have suggested you should do. Weird. That should invoked the issue. It was long time ago, and running a quick search I did not find the course, yet. When I find that specific course I will try to send it over, somehow. Since that incident, we are restoring a lot of courses and we did not have any more issues. But I guess it has to do with the SQL UPDATE to the table's structure. setting message field to LONGTEXT. If it is not causing any issues with Moodle code, please consider making that change in the DB.
          Hide
          Nadav Kavalerchik added a comment -

          I have searched some more for that course on our Moodle 19 servers and did not find it.
          The might have deleted the file or changed its name.

          I will add more details next time I have a similar issue. so it will be easier to refer to.

          Show
          Nadav Kavalerchik added a comment - I have searched some more for that course on our Moodle 19 servers and did not find it. The might have deleted the file or changed its name. I will add more details next time I have a similar issue. so it will be easier to refer to.
          Hide
          Mark Nelson added a comment -

          Ok, thanks Nadav. One question that may help answer this, is your database and the mdl_backup_logs table using the collation utf8_unicode?

          Show
          Mark Nelson added a comment - Ok, thanks Nadav. One question that may help answer this, is your database and the mdl_backup_logs table using the collation utf8_unicode?
          Hide
          Nadav Kavalerchik added a comment -

          We are using utf8_general_ci

          Show
          Nadav Kavalerchik added a comment - We are using utf8_general_ci
          Hide
          Mark Nelson added a comment -

          Hmm, then I can't explain why I can not replicate this issue. Nadav, I will be closing this issue shortly. Please let me know if you are able to replicate this issue in the future with the file you used and the exact steps so that I can assist you in solving this. Thanks for your help.

          Show
          Mark Nelson added a comment - Hmm, then I can't explain why I can not replicate this issue. Nadav, I will be closing this issue shortly. Please let me know if you are able to replicate this issue in the future with the file you used and the exact steps so that I can assist you in solving this. Thanks for your help.
          Hide
          Mark Nelson added a comment -

          I will try to replicate this again by changing my collation to utf8_general_ci, but do not believe this will make a difference. If I still can not replicate I will be closing.

          Show
          Mark Nelson added a comment - I will try to replicate this again by changing my collation to utf8_general_ci, but do not believe this will make a difference. If I still can not replicate I will be closing.
          Hide
          Mark Nelson added a comment -

          Hi Nadav, again it restored successfully. I am closing this issue now. As stated before, if you are able to replicate this and provide the file with detailed instructions so that I can replicate as well then that would be much appreciated. Thanks!

          Show
          Mark Nelson added a comment - Hi Nadav, again it restored successfully. I am closing this issue now. As stated before, if you are able to replicate this and provide the file with detailed instructions so that I can replicate as well then that would be much appreciated. Thanks!
          Hide
          Nadav Kavalerchik added a comment -

          Thank you!

          If I bump into a similar situation on one of my new Moodle 2.4 servers (when restoring Moodle 19 courses) which does not have the update to the table structure, I will re open this issue or link it to a new one.

          Show
          Nadav Kavalerchik added a comment - Thank you! If I bump into a similar situation on one of my new Moodle 2.4 servers (when restoring Moodle 19 courses) which does not have the update to the table structure, I will re open this issue or link it to a new one.
          Show
          Nadav Kavalerchik added a comment - Just now, It happened again. Here is a link to the Moodle 19 course backup: http://dl.dropbox.com/u/5576991/Moodle/Moodle19-backups/%D7%92%D7%99%D7%91%D7%95%D7%99-%D7%9E%D7%A0%D7%94%D7%99%D7%92%D7%95%D7%AA_%D7%97%D7%99%D7%A0%D7%95%D7%9B%D7%99%D7%AA-20130203-1037.zip
          Hide
          hanna edelman added a comment -

          We also have the same issue

          Debug info: Data too long for column 'message' at row 1
          INSERT INTO mdl_backup_logs (backupid,timecreated,loglevel,message) VALUES(?,?,?,?)
          [array (
          0 => '7721c1b99b2ca5edb7d3c8de1d534e7f',
          1 => 1359973363,
          2 => 30,
          3 => '(moodle1) error migrating file course_files/%D7%AA%D7%A8%D7%92%D7%99%D7%9C%D7%99%D7%9D_%D7%93%D7%9F/%D7%93%D7%9F_-_%D7%9E%D7%98%D7%9C%D7%94_1_-_%D7%91%D7%A2%D7%99%D7%95%D7%AA_%D7%94%D7%A0%D7%93%D7%A1%D7%94_%D7%A2%D7%9D_%D7%91%D7%A0%D7%99%D7%95%D7%AA_%D7%A2%D7%96%D7%A8.doc',
          )]
          Error code: dmlwriteexception
          Stack trace:
          
              line 410 of /lib/dml/moodle_database.php: dml_write_exception thrown
              line 1029 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
              line 1071 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 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 96 of /mod/assignment/backup/moodle1/lib.php: call to moodle1_converter::migrate_referenced_files()
              line 299 of /backup/converter/moodle1/lib.php: call to moodle1_mod_assignment_handler->process_assignment()
              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 212 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish()
              line ? of unknownfile: call to progressive_parser->start_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()
          
          Show
          hanna edelman added a comment - We also have the same issue Debug info: Data too long for column 'message' at row 1 INSERT INTO mdl_backup_logs (backupid,timecreated,loglevel,message) VALUES(?,?,?,?) [array ( 0 => '7721c1b99b2ca5edb7d3c8de1d534e7f', 1 => 1359973363, 2 => 30, 3 => '(moodle1) error migrating file course_files/%D7%AA%D7%A8%D7%92%D7%99%D7%9C%D7%99%D7%9D_%D7%93%D7%9F/%D7%93%D7%9F_-_%D7%9E%D7%98%D7%9C%D7%94_1_-_%D7%91%D7%A2%D7%99%D7%95%D7%AA_%D7%94%D7%A0%D7%93%D7%A1%D7%94_%D7%A2%D7%9D_%D7%91%D7%A0%D7%99%D7%95%D7%AA_%D7%A2%D7%96%D7%A8.doc', )] Error code: dmlwriteexception Stack trace: line 410 of /lib/dml/moodle_database.php: dml_write_exception thrown line 1029 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() line 1071 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 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 96 of /mod/assignment/backup/moodle1/lib.php: call to moodle1_converter::migrate_referenced_files() line 299 of /backup/converter/moodle1/lib.php: call to moodle1_mod_assignment_handler->process_assignment() 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 212 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish() line ? of unknownfile: call to progressive_parser->start_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()
          Hide
          Mark Nelson added a comment -

          Hi Nadav, I am currently busy on other issues but will look at this shortly. Thanks for supplying the backup! I will let you know how I go.

          Show
          Mark Nelson added a comment - Hi Nadav, I am currently busy on other issues but will look at this shortly. Thanks for supplying the backup! I will let you know how I go.
          Hide
          Nadav Kavalerchik added a comment -

          Hi Mark,
          Thank you! and you can take your time. no hurry since the workaround works fine.

          I have updated the Moodle schema on Hanna's servers (the comment above) with:

          ALTER TABLE mdl_backup_logs CHANGE message message LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''

          Which solved their problem too.

          Show
          Nadav Kavalerchik added a comment - Hi Mark, Thank you! and you can take your time. no hurry since the workaround works fine. I have updated the Moodle schema on Hanna's servers (the comment above) with: ALTER TABLE mdl_backup_logs CHANGE message message LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' Which solved their problem too.
          Hide
          Mark Nelson added a comment -

          Hi Nadav, I am leaving on a holiday to Whistler and won't be back to work on this until April. In the meantime, for those of you experiencing this issue Nadav has kindly provided a solution which will resolve this issue. I hope to find a solution when I get back which does not involve altering the database table (as that change will only be put in master - so will only get introduced in 2.5).

          Show
          Mark Nelson added a comment - Hi Nadav, I am leaving on a holiday to Whistler and won't be back to work on this until April. In the meantime, for those of you experiencing this issue Nadav has kindly provided a solution which will resolve this issue. I hope to find a solution when I get back which does not involve altering the database table (as that change will only be put in master - so will only get introduced in 2.5).
          Hide
          Nadav Kavalerchik added a comment -

          I got this issue once again, on another server.

          Mark Nelson, I think this fix should got into Moodle's schema.
          Do you want me to suggest a proper fix for this issue.
          Or do you have a better way to solve this?

          Show
          Nadav Kavalerchik added a comment - I got this issue once again, on another server. Mark Nelson , I think this fix should got into Moodle's schema. Do you want me to suggest a proper fix for this issue. Or do you have a better way to solve this?
          Hide
          Mark Nelson added a comment - - edited

          Hi Nadav,

          The issue with altering the table means that the fix will only be applied to the master branch, so in this case will only be applied to Moodle 2.6. Unfortunately this issue keeps being delayed as I begin working on other issues that affect more people, sorry about that. Eloy Lafuente (stronk7), Petr Škoda do you have any issue with altering the message field in the backup_logs table to resolve this issue? If not, do you think we could also backport it?

          Regards,

          Mark

          Show
          Mark Nelson added a comment - - edited Hi Nadav, The issue with altering the table means that the fix will only be applied to the master branch, so in this case will only be applied to Moodle 2.6. Unfortunately this issue keeps being delayed as I begin working on other issues that affect more people, sorry about that. Eloy Lafuente (stronk7) , Petr Škoda do you have any issue with altering the message field in the backup_logs table to resolve this issue? If not, do you think we could also backport it? Regards, Mark
          Hide
          Mark Nelson added a comment -

          Hi Nadav, spoke to Petr today. I will be working on a patch today to solve this issue. Thanks for your patience.

          Show
          Mark Nelson added a comment - Hi Nadav, spoke to Petr today. I will be working on a patch today to solve this issue. Thanks for your patience.
          Hide
          Mark Nelson added a comment -

          Ok, I lied. I will be working on it tomorrow as today is testing and peer review day.

          Show
          Mark Nelson added a comment - Ok, I lied. I will be working on it tomorrow as today is testing and peer review day.
          Hide
          Nadav Kavalerchik added a comment -

          Testing and Peer-reviewing is a holy task, you are forgiven

          I do not need this fix, personally, since I use "moosh sql-run" on all our client's servers to fix this issue.
          It's for the sake of others that might bump into this.

          Also, I think it can only happen if you are restoring Moodle 1.9.x backups into Moodle 2.x
          This will not happen in future Moodle releases.

          Show
          Nadav Kavalerchik added a comment - Testing and Peer-reviewing is a holy task, you are forgiven I do not need this fix, personally, since I use "moosh sql-run" on all our client's servers to fix this issue. It's for the sake of others that might bump into this. Also, I think it can only happen if you are restoring Moodle 1.9.x backups into Moodle 2.x This will not happen in future Moodle releases.
          Hide
          Mark Nelson added a comment -

          Hi Nadav, I am still strugging to replicate this issue with your backup.

          When I perform the backup I actually get the filename inserted correctly, eg. "(moodle1) error migrating the resource main file course_files/תמצית_המצפן_של_בית_ספר_מוריה.pdf" and do not get any decoding issues. I may just create my own backup with a very long filename to replicate this.

          Show
          Mark Nelson added a comment - Hi Nadav, I am still strugging to replicate this issue with your backup. When I perform the backup I actually get the filename inserted correctly, eg. "(moodle1) error migrating the resource main file course_files/תמצית_המצפן_של_בית_ספר_מוריה.pdf" and do not get any decoding issues. I may just create my own backup with a very long filename to replicate this.
          Hide
          Mark Nelson added a comment -

          Can you confirm that this is still an issue in 2.4 onwards? Thanks.

          Show
          Mark Nelson added a comment - Can you confirm that this is still an issue in 2.4 onwards? Thanks.
          Hide
          Mark Nelson added a comment -

          Woohoo, I was able to replicate this with a backup file I created. Working on fix now.

          Show
          Mark Nelson added a comment - Woohoo, I was able to replicate this with a backup file I created. Working on fix now.
          Hide
          Nadav Kavalerchik added a comment - - edited

          Yes. it is still an Issue for 2.4/5/6dev

          Show
          Nadav Kavalerchik added a comment - - edited Yes. it is still an Issue for 2.4/5/6dev
          Hide
          miki Alliel added a comment - - edited

          It happend to me moodle 2.5.1 while importing data from course to course with RTL lang (Hebrew) files in the resources of the course
          this is what I get: can't import:

          Unknown exception related to local files (Invalid file path)

          Debug info:
          Error code: storedfileproblem
          Stack trace:
          line 893 of /lib/filestorage/file_storage.php: file_exception thrown
          line 906 of /backup/util/dbops/restore_dbops.class.php: call to file_storage->create_directory()
          line 222 of /backup/util/plan/restore_structure_step.class.php: call to restore_dbops::send_files_to_pool()
          line 65 of /mod/folder/backup/moodle2/restore_folder_stepslib.php: call to restore_structure_step->add_related_files()
          line 366 of /backup/util/plan/restore_structure_step.class.php: call to restore_folder_activity_structure_step->after_execute()
          line 108 of /backup/util/plan/restore_structure_step.class.php: call to restore_structure_step->launch_after_execute_methods()
          line 153 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute()
          line 192 of /backup/moodle2/restore_activity_task.class.php: call to base_task->execute()
          line 163 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 315 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
          line 132 of /backup/import.php: call to restore_controller->execute_plan()

          Show
          miki Alliel added a comment - - edited It happend to me moodle 2.5.1 while importing data from course to course with RTL lang (Hebrew) files in the resources of the course this is what I get: can't import: Unknown exception related to local files (Invalid file path) Debug info: Error code: storedfileproblem Stack trace: line 893 of /lib/filestorage/file_storage.php: file_exception thrown line 906 of /backup/util/dbops/restore_dbops.class.php: call to file_storage->create_directory() line 222 of /backup/util/plan/restore_structure_step.class.php: call to restore_dbops::send_files_to_pool() line 65 of /mod/folder/backup/moodle2/restore_folder_stepslib.php: call to restore_structure_step->add_related_files() line 366 of /backup/util/plan/restore_structure_step.class.php: call to restore_folder_activity_structure_step->after_execute() line 108 of /backup/util/plan/restore_structure_step.class.php: call to restore_structure_step->launch_after_execute_methods() line 153 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute() line 192 of /backup/moodle2/restore_activity_task.class.php: call to base_task->execute() line 163 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 315 of /backup/controller/restore_controller.class.php: call to restore_plan->execute() line 132 of /backup/import.php: call to restore_controller->execute_plan()
          Hide
          Mark Nelson added a comment -

          Hi Miki, that is a separate issue. I suggest creating a separate tracker issue including replication steps so that a developer is able to reproduce this and then can work on a fix. If at all possible I would include the backup you were using to restore.

          Show
          Mark Nelson added a comment - Hi Miki, that is a separate issue. I suggest creating a separate tracker issue including replication steps so that a developer is able to reproduce this and then can work on a fix. If at all possible I would include the backup you were using to restore.
          Hide
          Mark Nelson added a comment -

          Nadav Kavalerchik - Yep, I was able to replicate this with a backup I created in 2.4, 2.5 and master. I have created a fix and am waiting for a review.

          Show
          Mark Nelson added a comment - Nadav Kavalerchik - Yep, I was able to replicate this with a backup I created in 2.4, 2.5 and master. I have created a fix and am waiting for a review.
          Hide
          Adrian Greeve added a comment -

          [Y] Syntax
          [Y] Whitespace
          [Y] Output
          [-] Language
          [-] Databases
          [*] Testing (instructions and automated tests)
          [Y] Security
          [-] Documentation
          [Y] Git
          [Y] Sanity check

          Hi Mark,

          The code for master and 2.4, 2.5 looks good. I couldn't spot any problems with it.
          The only suggestion that I have is to include a file that will generate the error before the patch. I tried a restore on your file with no fix and it loaded with no errors.

          Thanks for your time,

          Show
          Adrian Greeve added a comment - [Y] Syntax [Y] Whitespace [Y] Output [-] Language [-] Databases [*] Testing (instructions and automated tests) [Y] Security [-] Documentation [Y] Git [Y] Sanity check Hi Mark, The code for master and 2.4, 2.5 looks good. I couldn't spot any problems with it. The only suggestion that I have is to include a file that will generate the error before the patch. I tried a restore on your file with no fix and it loaded with no errors. Thanks for your time,
          Hide
          Mark Nelson added a comment - - edited

          After discussing with Adrian, the reason he did not get the error is because he performed the upgrade on master with my patch and tested it then he reverted my patch to test restoring the file, however after the upgrade the message field was converted to a text field which won't be converted back to a character field by reverting the patch. This meant the error did not display. So, the file DOES create an error as expected.

          Show
          Mark Nelson added a comment - - edited After discussing with Adrian, the reason he did not get the error is because he performed the upgrade on master with my patch and tested it then he reverted my patch to test restoring the file, however after the upgrade the message field was converted to a text field which won't be converted back to a character field by reverting the patch. This meant the error did not display. So, the file DOES create an error as expected.
          Hide
          Dan Poltawski added a comment -

          Integrated to master, 25 and 24 - thanks Mark

          Show
          Dan Poltawski added a comment - Integrated to master, 25 and 24 - thanks Mark
          Hide
          miki Alliel added a comment -

          I'm sorry ' this is the error I get after restoring a course with file (moodle 2.5.1) with rtl lang files
          Debug info: Data too long for column 'message' at row 1
          INSERT INTO mdl_backup_logs (backupid,timecreated,loglevel,message) VALUES(?,?,?,?)
          [array (
          0 => 'f0d4ded1e4a81741ca68781f2cd60fae',
          1 => 1377613555,
          2 => 30,
          3 => '(moodle1) error migrating the resource main file course_files/areallylongpointlessnameusedtocauseerrorsforanissueiamworkingonatmiamgoingtocontinue_writingabunchofrandomlythoughtoutwordsjustsoicangetalargeamountofcharactersinthisnameithinkiamnotdoingsuchabadjobdontyouagreewellyoubetteroriwillbeforcedtouseforce.jpg',
          )]
          Error code: dmlwriteexception
          Stack trace:
          line 426 of /lib/dml/moodle_database.php: dml_write_exception thrown
          line 1089 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
          line 1131 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 141 of /backup/converter/moodle1/handlerlib.php: call to moodle1_converter->log()
          line 208 of /mod/resource/backup/moodle1/lib.php: call to moodle1_handler->log()
          line 299 of /backup/converter/moodle1/lib.php: call to moodle1_mod_resource_handler->process_resource()
          line 748 of /backup/converter/moodle1/lib.php: call to moodle1_converter->process_chunk()
          line 139 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()

          Show
          miki Alliel added a comment - I'm sorry ' this is the error I get after restoring a course with file (moodle 2.5.1) with rtl lang files Debug info: Data too long for column 'message' at row 1 INSERT INTO mdl_backup_logs (backupid,timecreated,loglevel,message) VALUES(?,?,?,?) [array ( 0 => 'f0d4ded1e4a81741ca68781f2cd60fae', 1 => 1377613555, 2 => 30, 3 => '(moodle1) error migrating the resource main file course_files/areallylongpointlessnameusedtocauseerrorsforanissueiamworkingonatmiamgoingtocontinue_writingabunchofrandomlythoughtoutwordsjustsoicangetalargeamountofcharactersinthisnameithinkiamnotdoingsuchabadjobdontyouagreewellyoubetteroriwillbeforcedtouseforce.jpg', )] Error code: dmlwriteexception Stack trace: line 426 of /lib/dml/moodle_database.php: dml_write_exception thrown line 1089 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() line 1131 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 141 of /backup/converter/moodle1/handlerlib.php: call to moodle1_converter->log() line 208 of /mod/resource/backup/moodle1/lib.php: call to moodle1_handler->log() line 299 of /backup/converter/moodle1/lib.php: call to moodle1_mod_resource_handler->process_resource() line 748 of /backup/converter/moodle1/lib.php: call to moodle1_converter->process_chunk() line 139 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()
          Hide
          Mark Nelson added a comment -

          Hi Miki,

          The patch has not been put into a stable release yet. It needs to go through testing on our end, then will be pushed into the 2.4, 2.5 and master branch. Once the issue status has been set to 'Closed' you will need to then download the latest updates to retrieve the fix.

          Regards,

          Mark

          Show
          Mark Nelson added a comment - Hi Miki, The patch has not been put into a stable release yet. It needs to go through testing on our end, then will be pushed into the 2.4, 2.5 and master branch. Once the issue status has been set to 'Closed' you will need to then download the latest updates to retrieve the fix. Regards, Mark
          Hide
          Marina Glancy added a comment -

          Test passed. Successfully restored on 2.4, 2.5, master new, master upgraded. Thanks Mark

          Show
          Marina Glancy added a comment - Test passed. Successfully restored on 2.4, 2.5, master new, master upgraded. Thanks Mark
          Hide
          miki Alliel added a comment -

          Ok Thanks Mark' I'll watch and check it when it's ready

          Show
          miki Alliel added a comment - Ok Thanks Mark' I'll watch and check it when it's ready
          Hide
          Damyon Wiese added a comment -

          There was a young man named McGee
          Who thought squashing bugs was easy
          He tried it one day
          And to his dismay
          The bug guts made his keyboard all greasy

          Thanks!

          This has issue has been fixed and released in Moodle.

          Show
          Damyon Wiese added a comment - There was a young man named McGee Who thought squashing bugs was easy He tried it one day And to his dismay The bug guts made his keyboard all greasy Thanks! This has issue has been fixed and released in Moodle.

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Agile