nextcloud / files_antivirus

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

Fatal: OCA\Files_Antivirus\BackgroundJob\BackgroundScanner::run, exception: The antivirus executable could not be found at /usr/bin/clamscan #183

Closed dirtyharrywk closed 2 years ago

dirtyharrywk commented 3 years ago

Steps to reproduce

**

  1. Run Nextcloud
  2. Go to "Settings" > "Logging"
  3. Errors "OCA\Files_Antivirus\BackgroundJob\BackgroundScanner::run, exception: The antivirus executable could not be found at /usr/bin/clamscan" appear in log. Tons of them.**

Expected behaviour

Files to be scanned

Actual behaviour

Errors in log.

Server configuration

Operating system: Debian 9

Web server:. Lighttpd

Database: Mysql

PHP version: 7.3.25

Nextcloud version: 20.0.4

Where did you install Nextcloud from: Dietpi

List of activated apps:. Plex, Pi Hole, Nextcloud.

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

dan@cs2:/var/www/nextcloud# sudo -u www-data php occ app:list Enabled:

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

dan@cs2:/var/www/nextcloud# sudo -u www-data php occ config:list system
{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "*"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "20.0.4.0",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0
        },
        "overwrite.cli.url": "http:\/\/localhost\/nextcloud",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "theme": "",
        "loglevel": 2,
        "mail_smtpsecure": "ssl",
        "updater.release.channel": "stable"
    }
}
dan@cs2:/var/www/nextcloud# 

or

Insert your config.php content here

root@cs2:/var/www/nextcloud/config# cat config.php
<?php
$CONFIG = array (
  'passwordsalt' => 'XXXXXXXXXXXXXXXXXXX/',
  'secret' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '*',
  ),
  'datadirectory' => '/mnt/dietpi_userdata/nextcloud_data',
  'dbtype' => 'mysql',
  'version' => '20.0.4.0',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/run/redis/redis-server.sock',
    'port' => 0,
  ),
  'overwrite.cli.url' => 'http://localhost/nextcloud',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_admin',
  'dbpassword' => 'XXXXXXXXXXXXXXX',
  'installed' => true,
  'instanceid' => 'ocgqhag1zo8f',
  'maintenance' => false,
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => '********',
  'mail_domain' => '**********.com',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_smtpport' => '465',
  'mail_smtpname' => '******@*********.com',
  'mail_smtppassword' => '****************',
  'theme' => '',
  'loglevel' => 2,
  'mail_smtpsecure' => 'ssl',
  'updater.release.channel' => 'stable',
);
dan@cs2:/var/www/nextcloud/config# 

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

Client configuration

Browser:. Safari, Chrome and Firefox

Operating system:. MacOS

Logs

Nextcloud log (data/owncloud.log)

Insert your Nextcloud log here

Browser log

Insert your browser log here, this could for example include:
Not sure what you need here.
a) The javascript console log
b) The network log
c) ...
OfficialMuffin commented 3 years ago

Same issue here too. Most of the logs are just: RuntimeException: The antivirus executable could not be found at /usr/bin/clamscan.

Full log snippet here:

[files_antivirus] Error: RuntimeException: The antivirus executable could not be found at /usr/bin/clamscan at <<closure>>

 0. <<closure>>
    OCA\Files_Antivirus\Scanner\LocalClam->__construct(OCA\Files_Antivirus\AppConfig {}, OC\AppFramework\Logger {}, OCA\Files_Antivirus\StatusFactory {})
 1. /snap/nextcloud/27434/htdocs/lib/private/AppFramework/Utility/SimpleContainer.php line 101
    ReflectionClass->newInstanceArgs([OCA\Files_Antiv ... }])
 2. /snap/nextcloud/27434/htdocs/lib/private/AppFramework/Utility/SimpleContainer.php line 109
    OC\AppFramework\Utility\SimpleContainer->buildClass(ReflectionClass  ... "})
 3. /snap/nextcloud/27434/htdocs/lib/private/AppFramework/Utility/SimpleContainer.php line 126
    OC\AppFramework\Utility\SimpleContainer->resolve("OCA\\Files_Anti ... m")
 4. /snap/nextcloud/27434/htdocs/lib/private/AppFramework/DependencyInjection/DIContainer.php line 455
    OC\AppFramework\Utility\SimpleContainer->query("OCA\\Files_Anti ... m")
 5. /snap/nextcloud/27434/htdocs/lib/private/ServerContainer.php line 140
    OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback("OCA\\Files_Anti ... m")
 6. /var/snap/nextcloud/27434/nextcloud/extra-apps/files_antivirus/lib/Scanner/ScannerFactory.php line 45
    OC\ServerContainer->query("OCA\\Files_Anti ... m")
 7. /var/snap/nextcloud/27434/nextcloud/extra-apps/files_antivirus/lib/BackgroundJob/BackgroundScanner.php line 334
    OCA\Files_Antivirus\Scanner\ScannerFactory->getScanner()
 8. /var/snap/nextcloud/27434/nextcloud/extra-apps/files_antivirus/lib/BackgroundJob/BackgroundScanner.php line 121
    OCA\Files_Antivirus\BackgroundJob\BackgroundScanner->scanOneFile(OC\Files\Node\File {})
 9. /snap/nextcloud/27434/htdocs/lib/private/BackgroundJob/Job.php line 52
    OCA\Files_Antivirus\BackgroundJob\BackgroundScanner->run(null)
10. /snap/nextcloud/27434/htdocs/lib/private/BackgroundJob/TimedJob.php line 59
    OC\BackgroundJob\Job->execute(OC\BackgroundJob\JobList {}, OC\Log {})
11. /snap/nextcloud/27434/htdocs/cron.php line 127
    OC\BackgroundJob\TimedJob->execute(OC\BackgroundJob\JobList {}, OC\Log {})
kesselb commented 2 years ago

Thank you for taking the time to report a problem :+1:

As this seems to be a setup issue I would like to ask you to raise your question at https://help.nextcloud.com