nextcloud / files_antivirus

👾 Antivirus app for Nextcloud Files
https://apps.nextcloud.com/apps/files_antivirus
GNU Affero General Public License v3.0
85 stars 36 forks source link

Excessive error logs when daemon (ClamAV) is offline #221

Open stavros-k opened 2 years ago

stavros-k commented 2 years ago

Not really a bug, more like a feature request, that's why some of the fields are not populated.

Steps to reproduce

  1. Setup ClamAV (with IP)
  2. Shutdown the server hosting ClamAV
  3. Observe error spam

When Antivirus Scanner on Nextcloud (with ClamAV) lose connection with the daemon, it spits a ton of logging (like 2k errors in 5-10minutes time frame). RuntimeException: The ClamAV module is not in daemon mode. Daemon was offline for like 5-10 minutes (maintenance reboot on the server that was hosting it).

Expected behaviour

It would be nice to have this error once every X minutes or seconds. Right now it seems excessive

Actual behaviour

Get spammed with errors

Server configuration

Operating system: Unraid

Web server: nginx

Database: Postgres 13

PHP version: 7.4.26

Nextcloud version: (see Nextcloud admin page) 23.0.0 Stable

Where did you install Nextcloud from: Docker - linuxserver.io (23.0.0-ls170)

List of activated apps:

Antivirus 3.2.2

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Nextcloud configuration:

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or

Insert your config.php content here
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

Client configuration

Browser: Not Relevant

Operating system: Not Relevant

Logs

Nextcloud log (data/owncloud.log)

Tons of:

{"reqId":"wO1r6Z0h4RVZt0dOjhs1","level":3,"time":"Wed 26/01/2022 01:55:07","remoteAddr":"","user":"--","app":"files_antivirus","method":"","url":"--","message":"The ClamAV module is not in daemon mode.","userAgent":"--","version":"23.0.0.10","exception":{"Exception":"RuntimeException","Message":"The ClamAV module is not in daemon mode.","Code":0,"Trace":[{"file":"/config/www/nextcloud/apps/files_antivirus/lib/Scanner/ScannerBase.php","line":109,"function":"initScanner","class":"OCA\\Files_Antivirus\\Scanner\\ExternalClam","type":"->"},{"file":"/config/www/nextcloud/apps/files_antivirus/lib/BackgroundJob/BackgroundScanner.php","line":336,"function":"scan","class":"OCA\\Files_Antivirus\\Scanner\\ScannerBase","type":"->"},{"file":"/config/www/nextcloud/apps/files_antivirus/lib/BackgroundJob/BackgroundScanner.php","line":122,"function":"scanOneFile","class":"OCA\\Files_Antivirus\\BackgroundJob\\BackgroundScanner","type":"->"},{"file":"/config/www/nextcloud/lib/private/BackgroundJob/Job.php","line":51,"function":"run","class":"OCA\\Files_Antivirus\\BackgroundJob\\BackgroundScanner","type":"->"},{"file":"/config/www/nextcloud/lib/private/BackgroundJob/TimedJob.php","line":58,"function":"execute","class":"OC\\BackgroundJob\\Job","type":"->"},{"file":"/config/www/nextcloud/cron.php","line":128,"function":"execute","class":"OC\\BackgroundJob\\TimedJob","type":"->"}],"File":"/config/www/nextcloud/apps/files_antivirus/lib/Scanner/ExternalClam.php","Line":53,"CustomMessage":"--"}}
{"reqId":"wO1r6Z0h4RVZt0dOjhs1","level":3,"time":"Wed 26/01/2022 01:55:07","remoteAddr":"","user":"--","app":"files_antivirus","method":"","url":"--","message":"The ClamAV module is not in daemon mode.","userAgent":"--","version":"23.0.0.10","exception":{"Exception":"RuntimeException","Message":"The ClamAV module is not in daemon mode.","Code":0,"Trace":[{"file":"/config/www/nextcloud/apps/files_antivirus/lib/Scanner/ScannerBase.php","line":109,"function":"initScanner","class":"OCA\\Files_Antivirus\\Scanner\\ExternalClam","type":"->"},{"file":"/config/www/nextcloud/apps/files_antivirus/lib/BackgroundJob/BackgroundScanner.php","line":336,"function":"scan","class":"OCA\\Files_Antivirus\\Scanner\\ScannerBase","type":"->"},{"file":"/config/www/nextcloud/apps/files_antivirus/lib/BackgroundJob/BackgroundScanner.php","line":122,"function":"scanOneFile","class":"OCA\\Files_Antivirus\\BackgroundJob\\BackgroundScanner","type":"->"},{"file":"/config/www/nextcloud/lib/private/BackgroundJob/Job.php","line":51,"function":"run","class":"OCA\\Files_Antivirus\\BackgroundJob\\BackgroundScanner","type":"->"},{"file":"/config/www/nextcloud/lib/private/BackgroundJob/TimedJob.php","line":58,"function":"execute","class":"OC\\BackgroundJob\\Job","type":"->"},{"file":"/config/www/nextcloud/cron.php","line":128,"function":"execute","class":"OC\\BackgroundJob\\TimedJob","type":"->"}],"File":"/config/www/nextcloud/apps/files_antivirus/lib/Scanner/ExternalClam.php","Line":53,"CustomMessage":"--"}}
{"reqId":"wO1r6Z0h4RVZt0dOjhs1","level":3,"time":"Wed 26/01/2022 01:55:07","remoteAddr":"","user":"--","app":"files_antivirus","method":"","url":"--","message":"The ClamAV module is not in daemon mode.","userAgent":"--","version":"23.0.0.10","exception":{"Exception":"RuntimeException","Message":"The ClamAV module is not in daemon mode.","Code":0,"Trace":[{"file":"/config/www/nextcloud/apps/files_antivirus/lib/Scanner/ScannerBase.php","line":109,"function":"initScanner","class":"OCA\\Files_Antivirus\\Scanner\\ExternalClam","type":"->"},{"file":"/config/www/nextcloud/apps/files_antivirus/lib/BackgroundJob/BackgroundScanner.php","line":336,"function":"scan","class":"OCA\\Files_Antivirus\\Scanner\\ScannerBase","type":"->"},{"file":"/config/www/nextcloud/apps/files_antivirus/lib/BackgroundJob/BackgroundScanner.php","line":122,"function":"scanOneFile","class":"OCA\\Files_Antivirus\\BackgroundJob\\BackgroundScanner","type":"->"},{"file":"/config/www/nextcloud/lib/private/BackgroundJob/Job.php","line":51,"function":"run","class":"OCA\\Files_Antivirus\\BackgroundJob\\BackgroundScanner","type":"->"},{"file":"/config/www/nextcloud/lib/private/BackgroundJob/TimedJob.php","line":58,"function":"execute","class":"OC\\BackgroundJob\\Job","type":"->"},{"file":"/config/www/nextcloud/cron.php","line":128,"function":"execute","class":"OC\\BackgroundJob\\TimedJob","type":"->"}],"File":"/config/www/nextcloud/apps/files_antivirus/lib/Scanner/ExternalClam.php","Line":53,"CustomMessage":"--"}}

Browser log

Insert your browser log here, this could for example include:

Not Relevant