Ubuntu – Freshclam – Unable to complete download of main.cvd

clamav

After installing Ubuntu 18.04 some weeks ago, I tried to install clamav, that I was effectively using in my previous Kubuntu 14.10 system. The first step of clamav installation went well, but when I tried to download the signature database main.cvd with the freshclam command I wasn't able to proceed further.
I always get the error message "!Can't download main.cvd from db.it.clamav.net" EXACTLY when the download process arrives at 86%. I tried to change the mirror downloading site (.it, .fr) and to increase the timeout from 30 to 120, and also to re-run the command in several different days, but with no results.
Here is the series of messages I got from the Terminal:

fla-user@FLA-DESKTOP:~$ sudo freshclam -v
Thu Sep 27 20:58:18 2018 -> *Current working dir is /var/lib/clamav
Thu Sep 27 20:58:18 2018 -> *Max retries == 2
Thu Sep 27 20:58:18 2018 -> ClamAV update process started at Thu Sep 27 20:58:18 2018
Thu Sep 27 20:58:18 2018 -> *Using IPv6 aware code
Thu Sep 27 20:58:18 2018 -> *Querying current.cvd.clamav.net
Thu Sep 27 20:58:18 2018 -> *TTL: 702
Thu Sep 27 20:58:18 2018 -> *Software version from DNS: 0.100.1
Thu Sep 27 20:58:18 2018 -> *Retrieving http://db.it.clamav.net/main.cvd
Thu Sep 27 20:58:18 2018 -> *Trying to download http://db.it.clamav.net/main.cvd (IP: 104.16.189.138)
Thu Sep 27 21:01:44 2018 -> ^getfile: Download interrupted: Connection reset by peer (IP: 104.16.189.138)
Thu Sep 27 21:01:44 2018 -> ^Can't download main.cvd from db.it.clamav.net
Thu Sep 27 21:01:44 2018 -> *Querying main.0.92.0.0.6810BD8A.ping.clamav.net
Thu Sep 27 21:01:44 2018 -> *Can't query main.0.92.0.0.6810BD8A.ping.clamav.net
Thu Sep 27 21:01:44 2018 -> Trying again in 5 secs...
Thu Sep 27 21:01:49 2018 -> ClamAV update process started at Thu Sep 27 21:01:49 2018
Thu Sep 27 21:01:49 2018 -> *Using IPv6 aware code
Thu Sep 27 21:01:49 2018 -> *Querying current.cvd.clamav.net
Thu Sep 27 21:01:49 2018 -> *TTL: 877
Thu Sep 27 21:01:49 2018 -> *Software version from DNS: 0.100.1
Thu Sep 27 21:01:49 2018 -> *Retrieving http://db.it.clamav.net/main.cvd
Thu Sep 27 21:01:49 2018 -> *Trying to download http://db.it.clamav.net/main.cvd (IP: 104.16.187.138)
Thu Sep 27 21:05:27 2018 -> !getfile: Download interrupted: Connection reset by peer (IP: 104.16.187.138)
Thu Sep 27 21:05:27 2018 -> !Can't download main.cvd from db.it.clamav.net
Thu Sep 27 21:05:27 2018 -> *Querying main.0.92.0.0.6810BB8A.ping.clamav.net
Thu Sep 27 21:05:27 2018 -> *Can't query main.0.92.0.0.6810BB8A.ping.clamav.net
Thu Sep 27 21:05:27 2018 -> Giving up on db.it.clamav.net...
Thu Sep 27 21:05:27 2018 -> ClamAV update process started at Thu Sep 27 21:05:27 2018
Thu Sep 27 21:05:27 2018 -> *Using IPv6 aware code
Thu Sep 27 21:05:27 2018 -> *Querying current.cvd.clamav.net
Thu Sep 27 21:05:27 2018 -> *TTL: 659
Thu Sep 27 21:05:27 2018 -> *Software version from DNS: 0.100.1
Thu Sep 27 21:05:27 2018 -> *Retrieving http://database.clamav.net/main.cvd
Thu Sep 27 21:05:27 2018 -> *Trying to download http://database.clamav.net/main.cvd (IP: 104.16.186.138)
Thu Sep 27 21:08:54 2018 -> !getfile: Download interrupted: Connection reset by peer (IP: 104.16.186.138)
Thu Sep 27 21:08:54 2018 -> !Can't download main.cvd from database.clamav.net
Thu Sep 27 21:08:54 2018 -> *Querying main.0.92.0.0.6810BA8A.ping.clamav.net
Thu Sep 27 21:08:54 2018 -> *Can't query main.0.92.0.0.6810BA8A.ping.clamav.net
Thu Sep 27 21:08:54 2018 -> Giving up on database.clamav.net...
Thu Sep 27 21:08:54 2018 -> Update failed. Your network may be down or none of the mirrors listed in /etc/clamav/freshclam.conf is working. Check https://www.clamav.net/documents/official-mirror-faq for possible reasons.

Can anyone help me to solve the problem?
Thanks in advance.

Flavio

Best Answer

I ran into a similar issue: the clamav-freshclam service was filling up /var/log/clamav/freshclam.log with these timeout failures and when I shut down that service and did a manual run of freshclam, it would get partway through and then fail out. I found that in the config file /etc/clamav/freshclam.conf there are two timeout directives, one named ConnectTimeout and the other named RecieveTimeout, both of which were set to 30 by default. I changed the ConnectTimeout to 10 (no reason to wait more than 10 seconds for a connection) and set the Receive timeout to 120 (needed way more time to pull down definition files over my anemic DSL connection) and now both freshclam and the clamav-freshclam service are both able to update properly.