Files of size above 25 MB could not be uploaded

Created on 6 November 2024, about 1 month ago

I am using ClamAV version 2.0.2 in Drupal 10.3.6. I have a file upload field in which 'Maximum upload size' is 100 MB. When uploading files of size below 25 MB, it is uploading successfully. But when we upload files of size above 25 MB, it is showing the following error :

The specified file C6-A systems view(1).zip could not be uploaded.
The anti-virus scanner could not check the file, so the file cannot be uploaded. Contact the site administrator if this problem persists.

I have applied the following solutions :

1. Set MaxScanSize 100M, MaxFileSize 100M, StreamMaxLength 100M in clamd.conf
2. Checked any timeout settings in clamd.conf
3. Restart ClamAV after making these changes:
systemctl restart clamav-daemon
4. Set SecRequestBodyLimit 104857600 # 100 MB, SecRequestBodyInMemoryLimit 104857600 # 100 MB, LimitRequestBody 104857600 in apache
5. Set upload_max_filesize = 100M, post_max_size = 100M, max_input_vars = 5000 in php.ini

After applying these also, the files of size above 25 MB could not be uploaded. Any solution for this?

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇮🇳India AswathyAjish

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @AswathyAjish
  • 🇬🇧United Kingdom mcdruid 🇬🇧🇪🇺

    I'm afraid this is definitely a Support Request rather than an obvious problem with the Drupal module.

    The issue you're having could be quite specific to your environment.

    Making sure StreamMaxLength isn't too low would be one of the first things I'd recommend you check, but looks like you've done that already.

    If you really want to know what's happening, it might help to look at the clamd logs which might be at /var/log/clamav/clamav.log or perhaps going into syslog?

    If that doesn't help, you can perhaps use tcpdump or similar to capture the network traffic between Drupal and clamd when a scan fails, in order to see if there are any clues there.

    It would be good if the module did a better job of "surfacing" errors if that's possible; for example if the daemon responds with an error message.

    Not something I can work on right now, but if there's not already an issue for that in the module's queue it'd be good to file one.

    Have you made sure the module is in verbose mode to try to capture as much detail as you can about what's going on?

  • 🇬🇧United Kingdom manarth

    zip files of size above 25 MB

    Does this impact files larger than 25MB which are not zip/compressed?
    I wonder whether the uncompressed size and memory usage during decompression has an impact.

  • 🇮🇳India AswathyAjish

    I tried uploading 79.0 MB pptx file, but same error came for this also, as you can see in the attached screenshot "error.png".

  • 🇮🇳India AswathyAjish

    Fixed the issue by updating StreamMaxLength, MaxScanSize and MaxFileSize. Following are the updated configurations :

    clamconf -n
    Checking configuration files in /etc

    Config file: clamd.d/scan.conf
    ------------------------------
    LogSyslog = "yes"
    TCPSocket = "3310"
    TCPAddr = "127.0.0.1"
    StreamMaxLength = "115343360"
    User = "clamscan"
    MaxScanSize = "115343360"
    MaxFileSize = "115343360"

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024