files_antivirus
files_antivirus copied to clipboard
ClamAV Deamon (Socket) - stream_socket_client(): unable to connect to unix: clamd.ctl (Resource temporarily unavailable)
Hi,
My Nextcloud server is using the ClamAV Antivirus App running as Deamon (Socket). The setup followed the setup here: https://docs.nextcloud.com/server/12/admin_manual/configuration_server/antivirus_configuration.html
Steps to reproduce
- Unclear - happens some times when files are uploaded to nextcloud
- ...
Error Behavior
When one of my users uploaded a file yesterday night, the server got caught in a loop. The loop continuously produces the following error msgs:
Error files_antivirus OCA\Files_Antivirus\BackgroundScanner::run, exception: Cannot connect to â/var/run/clamav/clamd.ctlâ: Resource temporarily unavailable (code 11)
Error PHP stream_socket_client(): unable to connect to unix:///var/run/clamav/clamd.ctl (Resource temporarily unavailable) at /var/www/nextcloud/apps/files_antivirus/lib/Scanner/External.php#29
The server is throwing these error msgs at maximum CPU-capacity, so that it is fully occupied and not accessible anymore (also not via ssh). Hard-reboot was my only option to terminate it.
I am not sure if it is really connected to the file uploads, but the the nginx error.log (see below) suggests it.
Server configuration
Nextcloud version: 12.0.2 Operating system and version: Ubuntu 16.04.3 LTS Apache or nginx: nginx/1.13.0 PHP version: PHP 7.1.8
Where did you install Nextcloud from: nextcloud.com
List of activated apps: Enabled:
- activity: 2.5.2
- admin_audit: 1.2.0
- bookmarks: 0.10.1
- bruteforcesettings: 1.0.2
- calendar: 1.5.3
- comments: 1.2.0
- contacts: 1.5.3
- dav: 1.3.0
- encryption: 1.6.0
- federatedfilesharing: 1.2.0
- federation: 1.2.0
- files: 1.7.2
- files_antivirus: 1.1.0
- files_external: 1.3.0
- files_pdfviewer: 1.1.1
- files_sharing: 1.4.0
- files_texteditor: 2.4.1
- files_trashbin: 1.2.0
- files_versions: 1.5.0
- files_videoplayer: 1.1.0
- firstrunwizard: 2.1
- gallery: 17.0.0
- groupfolders: 1.1.0
- logreader: 2.0.0
- lookup_server_connector: 1.0.0
- nextcloud_announcements: 1.1
- notes: 2.3.1
- notifications: 2.0.0
- oauth2: 1.0.5
- password_policy: 1.2.2
- provisioning_api: 1.2.0
- serverinfo: 1.2.0
- sharebymail: 1.2.0
- survey_client: 1.0.0
- systemtags: 1.2.0
- theming: 1.3.0
- twofactor_backupcodes: 1.1.1
- updatenotification: 1.2.0
- user_external: 0.4
- workflowengine: 1.2.0
Disabled:
- user_ldap
Nextcloud configuration:
The output of my config.php:
<?php
$CONFIG = array (
âinstanceidâ => âxxxxâ,
âpasswordsaltâ => âxxxxâ,
âsecretâ => âxxxxâ,
âtrusted_domainsâ =>
array (
0 => âxxxxâ,
1 => âxxxxâ,
),
âdatadirectoryâ => â/nc_dataâ,
âdbtypeâ => âmysqlâ,
âversionâ => â12.0.2.0.â,
âdbnameâ => ânextcloudâ,
âdbhostâ => âlocalhostâ,
âdbtableprefixâ => âoc_â,
âdbuserâ => ânextcloudâ,
âdbpasswordâ => ânextcloudâ,
âmysql.utf8mb4â => true,
âhtaccess.RewriteBaseâ => â/â,
âoverwrite.cli.urlâ => â/â,
âoverwriteprotocolâ => âhttpsâ,
âloglevelâ => 2,
âlogtimezoneâ => âEurope/Berlinâ,
âlogfileâ => â/var/nc_data/nextcloud.logâ,
âlog_rotate_sizeâ => 104857600,
âcron_logâ => false,
âinstalledâ => true,
âfilesystem_check_changesâ => 1,
âquota_include_external_storageâ => false,
âknowledgebaseenabledâ => false,
âmemcache.localâ => â\OC\Memcache\APCuâ,
âfilelocking.enabledâ => âtrueâ,
âmemcache.lockingâ => â\OC\Memcache\Redisâ,
âredisâ =>
array (
âhostâ => â/var/run/redis/redis.sockâ,
âportâ => 0,
âtimeoutâ => 0.0,
),
âmaintenanceâ => false,
âthemeâ => ââ,
âintegrity.check.disabledâ => false,
âupdater.release.channelâ => âstableâ,
âenable_previewsâ => true,
âmail_smtpmodeâ => âsmtpâ,
âmail_smtpauthtypeâ => âLOGINâ,
âmail_smtphostâ => âmail.xxx.xxâ,
âmail_smtpportâ => âxxxxâ,
âmail_smtpsecureâ => âsslâ,
âmail_from_addressâ => âxxxxâ,
âmail_domainâ => 'xxxx,
âmail_smtpauthâ => 1,
âmail_smtpnameâ => âxxxxâ,
âmail_smtppasswordâ => âxxxxâ,
);
The output of my nginx error log in /var/log/nginx:
2017/09/06 00:21:40 [warn] 881#881: *50635 an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/0/01/0000000010 while reading upstream, client: 127.0.0.1, server: 127.0.0.1, request: âGET /remote.php/dav/files/user/FILE.mp3 HTTP/1.1â, upstream: âfastcgi://unix:/run/php/php7.1-fpm.sock:â, host: âmy_url.ioâ 2017/09/06 01:08:24 [error] 879#879: *52191 upstream timed out (110: Connection timed out) while reading response header from upstream, client: CLIENT-IP, server: my_url.io, request: âMOVE /remote.php/dav/uploads/userXY/3941241390/.file HTTP/1.1â, upstream: âhttp://127.0.0.1:82/remote.php/dav/uploads/userXY/3941241390/.fileâ, host: âmy_url.ioâ 2017/09/06 01:12:46 [error] 878#878: *51474 upstream timed out (110: Connection timed out) while reading response header from upstream, client: CLIENT-IP, server: my_url.io, request: âMOVE /remote.php/dav/uploads/userXY/3409823176/.file HTTP/1.1â, upstream: âhttp://127.0.0.1:82/remote.php/dav/uploads/userXY/3409823176/.fileâ, host: âmy_url.ioâ 2017/09/06 01:28:22 [error] 880#880: *53018 upstream timed out (110: Connection timed out) while reading response header from upstream, client: CLIENT-IP, server: my_url.io, request: âMOVE /remote.php/webdav/FILE.mp4 HTTP/2.0â, upstream: âhttp://127.0.0.1:82/remote.php/webdav/FILE.mp4â, host: âmy_url.ioâ 2017/09/06 01:35:12 [error] 879#879: *53192 upstream timed out (110: Connection timed out) while reading response header from upstream, client: CLIENT-IP, server: my_url.io, request: âMOVE /remote.php/dav/uploads/userXY/1672020373/.file HTTP/1.1â, upstream: âhttp://127.0.0.1:82/remote.php/dav/uploads/userXY/1672020373/.fileâ, host: âmy_url.ioâ 2017/09/06 01:55:46 [error] 879#879: *54854 upstream timed out (110: Connection timed out) while reading response header from upstream, client: CLIENT-IP, server: my_url.io, request: âMOVE /remote.php/dav/uploads/userXY/3616606520/.file HTTP/1.1â, upstream: âhttp://127.0.0.1:82/remote.php/dav/uploads/userXY/3616606520/.fileâ, host: âmy_url.ioâ 2017/09/06 02:14:09 [error] 880#880: *55439 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: 127.0.0.1, request: âGET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1â, upstream: âfastcgi://unix:/run/php/php7.1-fpm.sockâ, host: âmy_url.ioâ 2017/09/06 02:14:09 [error] 880#880: *55443 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: 127.0.0.1, request: âGET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1â, upstream: âfastcgi://unix:/run/php/php7.1-fpm.sockâ, host: âmy_url.ioâ 2017/09/06 02:14:09 [error] 880#880: *55447 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: 127.0.0.1, request: âGET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1â, upstream: âfastcgi://unix:/run/php/php7.1-fpm.sockâ, host: âmy_url.ioâ 2017/09/06 02:18:32 [error] 878#878: *55464 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: 127.0.0.1, request: âGET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1â, upstream: âfastcgi://unix:/run/php/php7.1-fpm.sockâ, host: âmy_url.ioâ 2017/09/06 02:18:32 [error] 878#878: *55466 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: 127.0.0.1, request: âGET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1â, upstream: âfastcgi://unix:/run/php/php7.1-fpm.sockâ, host: âmy_url.ioâ 2017/09/06 02:18:32 [error] 878#878: *55473 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: 127.0.0.1, request: âGET /status.php HTTP/1.1â, upstream: âfastcgi://unix:/run/php/php7.1-fpm.sockâ, host: âmy_url.ioâ 2017/09/06 02:24:34 [error] 879#879: *55527 upstream timed out (110: Connection timed out) while reading response header from upstream, client: CLIENT-IP, server: my_url.io, request: âGET /apps/activity/ HTTP/2.0â, upstream: âhttp://127.0.0.1:82/apps/activity/â, host: âmy_url.ioâ 2017/09/06 02:29:34 [error] 879#879: *55534 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: 127.0.0.1, request: âGET /apps/activity/ HTTP/1.1â, upstream: âfastcgi://unix:/run/php/php7.1-fpm.sockâ, host: âmy_url.ioâ