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

File upload fails silently on NFS volume with no space remaining

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.1.5, 3.2.2
    • 3.1.4, 3.2.1
    • Libraries
    • MOODLE_31_STABLE, MOODLE_32_STABLE
    • MOODLE_31_STABLE, MOODLE_32_STABLE
    • MDL-57801-master
    • Hide
      1. Mount a small NFS volume as your moodledata directory (if possible).
      2. Apply the first commit from this patch (the one to verify the hash).
      3. Upload a file (or files) large enough to fill the data volume.
      4. Verify that the filesystem is now 100% full.
      5. Attempt to upload another file.
      6. Verify that the upload has failed.
      7. Delete some files to free up some space.
      8. Apply the second commit, and attempt to fill the volume again.
      9. Verify that the upload that would fill the volume has now failed.
      Show
      Mount a small NFS volume as your moodledata directory (if possible). Apply the first commit from this patch (the one to verify the hash). Upload a file (or files) large enough to fill the data volume. Verify that the filesystem is now 100% full. Attempt to upload another file. Verify that the upload has failed. Delete some files to free up some space. Apply the second commit, and attempt to fill the volume again. Verify that the upload that would fill the volume has now failed.

      Admittedly this is the edgiest of edge cases, and for all I know it may even be restricted to certain NFS implementations/configurations, but we got bitten by it fairly badly.

      For some reason the full NFS filesystem creates a zero byte temp file but with the hash of the original file. However, the filesize check in add_file_to_pool() somehow passes anyway. So I've added another check to verify the content hash of the temp file, and fortunately this fails for the zero byte file.

      I also discovered while testing this that if someone uploads a large file that fills the remaining space, this temp file is never deleted and the filesystem stays full, so I've included a fix for that too in a separate commit (this doesn't seem to be restricted to NFS filesystems).

            tonybutler Tony Butler
            tonybutler Tony Butler
            Ankit Agarwal Ankit Agarwal
            David Monllaó David Monllaó
            Rajesh Taneja Rajesh Taneja
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.