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

Allow virus checks to be retried if they returned an error state

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Setup email to receive Moodle notification

      1. Ensure that mailcatcher / mailhog / outgoing e-mail is configured

      Enable Clamav

      1. Navigate to Site administration -> Plugins -> Antivirus
      2. Enable clamav on Moodle site
      3. Specify an INVALID path to clamscan (This will cause error while scanning), for example:

        /this/is/fake
        

      Enable retries

      # Go to Site Admin > Plugins > Antivirus > ClamAV Antivirus

      1. Set "Scanning Attempts" to "3"

      Upload file

      1. Upload any file to your private files

      Expected behaviour

      1. Admin users should receive one email with content:

        Clamav scanning has tried 3 time(s).
         
        Path to ClamAV, /this/is/fake , is invalid.
        

      Show
      Setup email to receive Moodle notification Ensure that mailcatcher / mailhog / outgoing e-mail is configured Enable Clamav Navigate to Site administration -> Plugins -> Antivirus Enable clamav on Moodle site Specify an INVALID path to clamscan (This will cause error while scanning), for example: /this/is/fake Enable retries # Go to Site Admin > Plugins > Antivirus > ClamAV Antivirus Set "Scanning Attempts" to "3" Upload file Upload any file to your private files Expected behaviour Admin users should receive one email with content: Clamav scanning has tried 3 time(s).   Path to ClamAV, /this/is/fake , is invalid.
    • Affected Branches:
      MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_39_STABLE
    • Pull Master Branch:
      MDL-67504-Master

      Description

      Sometimes a virus clamav socket doesn't repsond, which spams the entire list of admins with an email they can't do much about.

      Handling the email better is covered by MDL-66222. This issue is about making it more forgiving and just retrying the virus check that failed, maybe 2 or 3 times before giving up.

      Also extra debugging info in the email:

      1) size of the files (as well as it's path)

      2) it's sha1 hash

      3) anything else we have handy, eg it's mimetype and ideally it's original filename

      4) the user id who uploaded it

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Nguyen Nathan Nguyen
              Reporter:
              brendanheywood Brendan Heywood
              Peer reviewer:
              Brendan Heywood
              Integrator:
              Andrew Nicols
              Tester:
              Janelle Barcega
              Participants:
              Component watchers:
              Matteo Scaramuccia, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/Jun/20

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 43 minutes
                  43m