Mattermost 7.10, uploading files is stuck on processing while ClamAV is on

HI,
We are running a Mattermost 7.10 server self-hosted and we want to turn on the clamAV plugin.
We have the mattermost server running through docker and tried to run another container for the clamAV service through

docker run -e CLAMD_CONF_MaxFileSize=50M -d -p 3310:3310 mkodockx/docker-clamav

And also adding clamav as a service in our docker-compose.yml file

But the thing is that when we configure clamAV plugin and point it to localhost:3310, looks like it can’t connect to it and in consequence we can’t send files through mattermost

Is there some way to have both services (mattermost & clamAV) running in different containers and make it work?

Thanks

Hi @ivan1 and welcome to the Mattermost forums!

You cannot connect to localhost:3310 from one container to the other. localhost will always only be reachable from within a container itself and all services you want to reach from there need to be running in the same container.
Each docker container gets its own IP address in your docker network and the containers can usually communicate with each other using the container names.

Can you post the output of the following commands, please?

docker inspect <mattermostcontainerid>| jq .[].NetworkSettings.Networks
docker inspect <clamavcontainerid>| jq .[].NetworkSettings.Networks

The output will look like this (I’ve removed irrelevant parts):

{
  "mm-780_default": {
    "Aliases": [
      "mm-780-mattermost-1",
      "mattermost",
      "2c68b8873807"
    ],
    "IPAddress": "172.29.0.3",
  }
}

As you can see, my container is in the network mm-780_default and has the IP address 172.29.0.3 and is reachable via the names mm-780-mattermost-1, mattermost and 2c68b8873807.

Your clamav container needs to be in the same network so that the containers can talk to each other using the docker network, alternatively you can route the traffic through your host if you do not want to put them in the same network.

If you want to communicate via the host, you need to put the IP address of the docker host (not the localhost IP) into the clamav plugin’s configuration, so that the connections goes from the mattermost container to your docker host, turns around there and goes back into your clamav container.

1 Like

Hi @agriesser thank you for your help and your quick response.

Now I see it clearly, here is the output of the mattermost container:

{
  "mattermost": {
    "IPAMConfig": null,
    "Links": null,
    "Aliases": [
      "docker-mattermost-1",
      "mattermost",
      "39e4bc408cd2"
    ],
    "NetworkID": "1c24ee5a3b2c5ebc9d66a4a0a37d072af8e12a7af5e9af150cba65d8c3119044",
    "EndpointID": "cd723e9a28103a4604af0f132c560526721adeabc0ab6931eeb06236f92f260d",
    "Gateway": "172.18.0.1",
    "IPAddress": "172.18.0.5",
    "IPPrefixLen": 16,
    "IPv6Gateway": "",
    "GlobalIPv6Address": "",
    "GlobalIPv6PrefixLen": 0,
    "MacAddress": "02:42:ac:12:00:05",
    "DriverOpts": null
  }
}

And the output of the clamav container:

{
  "mattermost": {
    "IPAMConfig": null,
    "Links": null,
    "Aliases": [
      "nextav",
      "av",
      "1491fd2ee852"
    ],
    "NetworkID": "1c24ee5a3b2c5ebc9d66a4a0a37d072af8e12a7af5e9af150cba65d8c3119044",
    "EndpointID": "ee03e6140f369d3314db1d11f2447d0db4667d06c42f0459f5f0dad8aadf8f18",
    "Gateway": "172.18.0.1",
    "IPAddress": "172.18.0.2",
    "IPPrefixLen": 16,
    "IPv6Gateway": "",
    "GlobalIPv6Address": "",
    "GlobalIPv6PrefixLen": 0,
    "MacAddress": "02:42:ac:12:00:02",
    "DriverOpts": null
  }
}

I recently configured the plugin pointing to 172.18.0.2:3310, and now I can send many files correctly, I tested it sending the EICAR test file, and it keeps stuck on processing (I can’t send it, so It’s ok), but It doesn’t show me any error message such as the one in the github project:
image

This is the final result:
image

So my question is if this is how it should work or am I missing something?

Once again, thanks for your help