- Issue created by @KlemenDEV
- 🇺🇸United States uazpbarabe
I'm seeing similar behavior using version 2.0.1 with Drupal 10. This is happening both on an instance hosted on Pantheon as well as in a development stack running on Lando. Uploads fail regardless of scan mechanism (I've tested Executable and both Daemon mode options. The site logs error messages like:
Error: Call to undefined method Drupal\Core\Extension\ModuleHandler::getImplementations() in Drupal\clamav\Scanner->isScannable() (line 120 of /app/web/modules/contrib/clamav/src/Scanner.php).
- 🇸🇮Slovenia KlemenDEV
Any new findings? Or a way to get this working/workaround?
- 🇸🇮Slovenia KlemenDEV
I've had this happen with 2.0.2-rc1. Did you change anything else that made it work?
- 🇺🇸United States uazpbarabe
@KlemenDEV The issue I experienced was due to a change in the Drupal 10 ModuleHandler API.
That was fixed in issue 3324573 🐛 D10: Call to undefined method Drupal\Core\Extension\ModuleHandler::getImplementations() Fixed , which was then included in ClamAV release 2.0.2 →
I would expect upgrading to 2.0.2 to resolve this for you (unless your root cause is due to some other issue).
- 🇸🇮Slovenia KlemenDEV
Ok tested with 2.0.2, same problem. Nothing is logged in the logs, the status page detects ClamAV correctly, though.
Code still seems to hang at
$response = trim(fgets($scanner_handler));
- 🇬🇧United Kingdom mcdruid 🇬🇧🇪🇺
Can you perhaps try using
clamdscan
as an example client to verify that it's possible to interact with your clamd instance successfully from the same place that PHP is running?https://linux.die.net/man/1/clamdscan
https://linux.die.net/man/5/clamd.conf - 🇸🇮Slovenia KlemenDEV
Hi, thanks for the suggestion. I will verify this asap
- 🇸🇮Slovenia KlemenDEV
I think this is indeed a file permissions issue as the daemon can't access the files.
It may be good to log some error when this happens
- 🇸🇮Slovenia KlemenDEV
Turns out it was apparmor issue on Ubuntu. Adding Drupal files folder to AppArmor read permission for clamav fixed this.
I will leave issue open if someone wants to add some logging (if this is technically doable) to this module to not just silently fail in those cases
- Status changed to Closed: works as designed
11 months ago 7:02pm 24 February 2024 - 🇦🇺Australia dpi Perth, Australia
Happy to get more logging if its possible and useful, until then, closing as to not leave issues open forever without active work.