Cannot Connect to ClamAV With Socket

Created on 25 September 2022, over 2 years ago
Updated 16 July 2024, 6 months ago

I am trying to use this module with ClamAV installed on a RHEL 8 VM. ClamAV is installed and working but I cannot use the "Daemon mode (over Unix socket)" in the module.

When I attempt to save file to the machine I get this error. Unable to connect to ClamAV daemon on unix socket /tmp/clamav/clamd.socket

I can see the socket is listening:
sh-4.4$ ss -elx | grep -w "$(stat -c 'ino:%i dev:0/%d' /tmp/clamav/clamd.socket)"
u_str LISTEN 0 128 /tmp/clamav/clamd.socket 12983133 * 0 <-> ino:33670817 dev:0/66307 peers:

I have tried multiple configurations. The current configuration has the clamd.socket file owned by ssm-user (the owner of web files) and the apache group that is the group for all the web files.

sh-4.4$ ls -la /tmp/clamav/clamd.socket
srw-rw-rw-. 1 ssm-user apache 0 Sep 25 13:22 /tmp/clamav/clamd.socket

These permissions are configured with the scan.conf file.

I have this module working using the executable but that is untenably slow.

Any help is greatly appreciated.

Thanks,
Steve

💬 Support request
Status

Needs review

Version

2.0

Component

Code

Created by

🇺🇸United States peoriadrupaluser

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India dev2.addweb

    Hi,
    I have encountered same issue for configuration and connection of ClamAV


    Then I configure lando file like below and rebuild lando it solved my problem
    by proper configure lando file.

    My .lando.yml file is as below and after updating this please run lando rebuild

    name: lando-d10
    recipe: drupal10
    config:
      webroot: web
    services:
      pma:
        type: phpmyadmin
      appserver:
        build_as_root:
          - apt-get update -y
          - apt-get install clamav clamav-daemon -y
          - echo "TCPSocket 3310" >> /etc/clamav/clamd.conf
          - freshclam
          - update-rc.d clamav-daemon enable
        run_as_root:
          - service clamav-daemon start
    

    Create a article page and add image before and after updating lando file
    After updating lando file
    Create a article page and add image and seen recent log

    You can also configure same as ddev also.
    I hope this helps anyone facing a similar issue!

  • Status changed to Closed: works as designed 3 months ago
  • 🇬🇧United Kingdom manarth

    This relates to configuration of the ClamAV service, rather than the Drupal moduke.

Production build 0.71.5 2024