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

Backup/restore: Error saving files - log messages are unhelpful

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6.1, 2.7
    • Fix Version/s: 2.6.1
    • Component/s: Backup
    • Labels:
    • Testing Instructions:
      Hide

      This test requires access to the filesystem used to store the moodledata area.

      SETUP:

      1. Create a new empty course with default settings.
      2. Add a File resource to the course with name 'file to be deleted' and using the attached file willdelete.txt.
      3. Delete the following file from your test server's moodledata: filedir/15/f6/15f67f8c57f0aa224aa71461e993c2ce3cea05f4

      BACKUP:

      4. Choose Backup and proceed through backup with default settings.

      EXPECTED: On final screen the log ('Technical information and warnings') shows. This should include a line like the below (with different number and path):

      Missing file in pool: /willdelete.txt (context 334877 'File: file to be deleted', component mod_resource, filearea content, itemid 0) [/fs1/www_root/filedir/15/f6/15f67f8c57f0aa224aa71461e993c2ce3cea05f4]

      If you have developer debug on, there should be some other lines about loading controller, setting status, blah blah. Otherwise this should be the only line.

      RESTORE:

      5. Restore the backed-up file to new course using default settings.

      EXPECTED: The log ('Technical information and warnings') should show information about the missing file. This is similar to the information above except that I didn't include the context name and the filesystem location is not included/relevant. Example:

      Missing file in backup: /willdelete.txt (old context 334877, component mod_resource, filearea content, old itemid 0)

      Again, if you have developer debug turned on there should be some other lines, otherwise just this one.

      Show
      This test requires access to the filesystem used to store the moodledata area. SETUP: 1. Create a new empty course with default settings. 2. Add a File resource to the course with name 'file to be deleted' and using the attached file willdelete.txt. 3. Delete the following file from your test server's moodledata: filedir/15/f6/15f67f8c57f0aa224aa71461e993c2ce3cea05f4 BACKUP: 4. Choose Backup and proceed through backup with default settings. EXPECTED: On final screen the log ('Technical information and warnings') shows. This should include a line like the below (with different number and path): Missing file in pool: /willdelete.txt (context 334877 'File: file to be deleted', component mod_resource, filearea content, itemid 0) [/fs1/www_root/filedir/15/f6/15f67f8c57f0aa224aa71461e993c2ce3cea05f4] If you have developer debug on, there should be some other lines about loading controller, setting status, blah blah. Otherwise this should be the only line. RESTORE: 5. Restore the backed-up file to new course using default settings. EXPECTED: The log ('Technical information and warnings') should show information about the missing file. This is similar to the information above except that I didn't include the context name and the filesystem location is not included/relevant. Example: Missing file in backup: /willdelete.txt (old context 334877, component mod_resource, filearea content, old itemid 0) Again, if you have developer debug turned on there should be some other lines, otherwise just this one.
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-42815-master

      Description

      1. When backing up a site, you may get an error at the end:

      'Some files could not be saved during the backup, it won't be possible to restore them'

      This is not very helpful as it does not list the files. A suitable place to list the files would be in the backup log, which we are now (2.6) displaying to users if there are any errors in it.

      2. When restoring the backup, you DO get a list of the affected files in the log, but the list is not in a very useful format as it basically includes only the filename and not any of the other available information.

      Note: At this stage I am not sure exactly what causes the error although I assume it's because there's something odd in the filesystem, like it doesn't have content in the file storage for certain files.

      The intent of improving this error is so that users can evaluate whether the file(s) are important and possibly go find them and fix them in the course before backing it up. The backup error is most important because by the time you're restoring, it's already too late.

      I propose to fix this as follows:

      1. Add log entry for each file that it fails to save in backup.

      2. In both the new log entry for backup, and the existing one for restore, add information about the file location (at minimum by including the numeric context ID or other IDs involved; at least in backup it might also be possible to display an activity name or something).

      Hopefully this will be a minor change.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    13/Jan/14