Hi,
it seems to time out on you :-/

By default that should be done automatically in background by the
service:

root@b:~# systemctl status clamav-freshclam.service
● clamav-freshclam.service - ClamAV virus database updater
   Loaded: loaded (/lib/systemd/system/clamav-freshclam.service; enabled; 
vendor preset: enabled)
   Active: active (running) since Fri 2020-03-06 10:20:51 UTC; 3min 6s ago
     Docs: man:freshclam(1)
           man:freshclam.conf(5)
           https://www.clamav.net/documents
 Main PID: 22378 (freshclam)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/clamav-freshclam.service
           └─22378 /usr/bin/freshclam -d --foreground=true

Mar 06 10:21:11 b freshclam[22378]: Fri Mar  6 10:21:11 2020 -> daily.cvd 
updated (version: 25742, sigs: 2208177, f-level: 63, builder: raynman)
Mar 06 10:21:11 b freshclam[22378]: Fri Mar  6 10:21:11 2020 -> main database 
available for download (remote version: 59)
Mar 06 10:21:28 b freshclam[22378]: Fri Mar  6 10:21:28 2020 -> Testing 
database: 
'/var/lib/clamav/tmp.0b342/clamav-ea8e6554afa4b49023af11272e09532f.tmp-main.cvd'
 ...
Mar 06 10:21:35 b freshclam[22378]: Fri Mar  6 10:21:35 2020 -> Database test 
passed.
Mar 06 10:21:35 b freshclam[22378]: Fri Mar  6 10:21:35 2020 -> main.cvd 
updated (version: 59, sigs: 4564902, f-level: 60, builder: sigmgr)
Mar 06 10:21:35 b freshclam[22378]: Fri Mar  6 10:21:35 2020 -> bytecode 
database available for download (remote version: 331)
Mar 06 10:21:35 b freshclam[22378]: Fri Mar  6 10:21:35 2020 -> Testing 
database: 
'/var/lib/clamav/tmp.0b342/clamav-7daed3263eb26f753d70cec595669ca0.tmp-bytecode.cvd'
 ...
Mar 06 10:21:36 b freshclam[22378]: Fri Mar  6 10:21:36 2020 -> Database test 
passed.
Mar 06 10:21:36 b freshclam[22378]: Fri Mar  6 10:21:36 2020 -> bytecode.cvd 
updated (version: 331, sigs: 94, f-level: 63, builder: anvilleg)
Mar 06 10:21:36 b freshclam[22378]: Fri Mar  6 10:21:36 2020 -> !NotifyClamd: 
Can't find or parse configuration file /etc/clamav/clamd.conf


And its full log (could be usefull to attach that to the bug) would look like:
root@b:~# journalctl -u clamav-freshclam.service
-- Logs begin at Tue 2019-12-17 08:53:23 UTC, end at Fri 2020-03-06 10:23:51 
UTC. --
Mar 06 10:20:51 b systemd[1]: clamav-freshclam.service: Failed to reset 
devices.list: Operation not permitted
Mar 06 10:20:51 b systemd[1]: Started ClamAV virus database updater.
Mar 06 10:20:51 b freshclam[22378]: Fri Mar  6 10:20:51 2020 -> ClamAV update 
process started at Fri Mar  6 10:20:51 2020
Mar 06 10:20:51 b systemd[1]: clamav-freshclam.service: Failed to reset 
devices.list: Operation not permitted
Mar 06 10:20:51 b systemd[1]: clamav-freshclam.service: Failed to reset 
devices.list: Operation not permitted
Mar 06 10:20:53 b freshclam[22378]: Fri Mar  6 10:20:53 2020 -> daily database 
available for download (remote version: 25742)
Mar 06 10:21:04 b freshclam[22378]: Fri Mar  6 10:21:04 2020 -> Testing 
database: 
'/var/lib/clamav/tmp.0b342/clamav-d27d67a14d4730fa24f41ecf9e5e83a8.tmp-daily.cvd'
 ...
Mar 06 10:21:11 b freshclam[22378]: Fri Mar  6 10:21:11 2020 -> Database test 
passed.
Mar 06 10:21:11 b freshclam[22378]: Fri Mar  6 10:21:11 2020 -> daily.cvd 
updated (version: 25742, sigs: 2208177, f-level: 63, builder: raynman)
Mar 06 10:21:11 b freshclam[22378]: Fri Mar  6 10:21:11 2020 -> main database 
available for download (remote version: 59)
Mar 06 10:21:28 b freshclam[22378]: Fri Mar  6 10:21:28 2020 -> Testing 
database: 
'/var/lib/clamav/tmp.0b342/clamav-ea8e6554afa4b49023af11272e09532f.tmp-main.cvd'
 ...
Mar 06 10:21:35 b freshclam[22378]: Fri Mar  6 10:21:35 2020 -> Database test 
passed.
Mar 06 10:21:35 b freshclam[22378]: Fri Mar  6 10:21:35 2020 -> main.cvd 
updated (version: 59, sigs: 4564902, f-level: 60, builder: sigmgr)
Mar 06 10:21:35 b freshclam[22378]: Fri Mar  6 10:21:35 2020 -> bytecode 
database available for download (remote version: 331)
Mar 06 10:21:35 b freshclam[22378]: Fri Mar  6 10:21:35 2020 -> Testing 
database: 
'/var/lib/clamav/tmp.0b342/clamav-7daed3263eb26f753d70cec595669ca0.tmp-bytecode.cvd'
 ...
Mar 06 10:21:36 b freshclam[22378]: Fri Mar  6 10:21:36 2020 -> Database test 
passed.
Mar 06 10:21:36 b freshclam[22378]: Fri Mar  6 10:21:36 2020 -> bytecode.cvd 
updated (version: 331, sigs: 94, f-level: 63, builder: anvilleg)
Mar 06 10:21:36 b freshclam[22378]: Fri Mar  6 10:21:36 2020 -> !NotifyClamd: 
Can't find or parse configuration file /etc/clamav/clamd.conf

For tha manual refresh as you show it to work the service needs to stop anyway.
Did you do that and why (probably as part of the debugging)?

I stopped my service as well and removed the databases.

I see it doing the download (fast in my case at first):

root@b:~# freshclam 
Fri Mar  6 10:27:03 2020 -> ClamAV update process started at Fri Mar  6 
10:27:03 2020
Fri Mar  6 10:27:03 2020 -> daily database available for download (remote 
version: 25742)
Time: 7.0s, ETA: 0.0s [=============================>] 56.84MiB/56.84MiB        
Fri Mar  6 10:27:12 2020 -> Testing database: 
'/var/lib/clamav/tmp.8c5eb/clamav-6c089d19b1ffd905e9881b7cc51b5569.tmp-daily.cvd'
 ...
Fri Mar  6 10:27:19 2020 -> Database test passed.
Fri Mar  6 10:27:19 2020 -> daily.cvd updated (version: 25742, sigs: 2208177, 
f-level: 63, builder: raynman)
Fri Mar  6 10:27:19 2020 -> main database available for download (remote 
version: 59)
Time: 13.8s, ETA: 0.0s [=============================>] 112.40MiB/112.40MiB     
 
Fri Mar  6 10:27:37 2020 -> Testing database: 
'/var/lib/clamav/tmp.8c5eb/clamav-01e095cdfa60cbc46c5012a1e658b59b.tmp-main.cvd'
 ...
Fri Mar  6 10:27:43 2020 -> Database test passed.
Fri Mar  6 10:27:43 2020 -> main.cvd updated (version: 59, sigs: 4564902, 
f-level: 60, builder: sigmgr)
Fri Mar  6 10:27:43 2020 -> bytecode database available for download (remote 
version: 331)
Time: 0.2s, ETA: 0.0s [=============================>] 289.44KiB/289.44KiB     
Fri Mar  6 10:27:43 2020 -> Testing database: 
'/var/lib/clamav/tmp.8c5eb/clamav-1d325f44a96c8eaac1f1d0ae6043e35d.tmp-bytecode.cvd'
 ...
Fri Mar  6 10:27:45 2020 -> Database test passed.
Fri Mar  6 10:27:45 2020 -> bytecode.cvd updated (version: 331, sigs: 94, 
f-level: 63, builder: anvilleg)
Fri Mar  6 10:27:45 2020 -> !NotifyClamd: Can't find or parse configuration 
file /etc/clamav/clamd.conf


You could also try --verbose and --debug if anything special happens before 
your timeouts (some locking or hang).

Now let me slow it down to recreate your case to be above 30 seconds.

root@b:~# tc qdisc show dev eth0
qdisc noqueue 0: root refcnt 2
root@b:~# tc qdisc add dev eth0 root handle 1: htb default 12
root@b:~# tc class add dev eth0 parent 1:1 classid 1:12 htb rate 14kbps ceil 
14kbps
root@b:~# tc qdisc add dev eth0 parent 1:12 netem delay 250ms
root@b:~# tc qdisc show dev eth0
qdisc htb 1: root refcnt 2 r2q 10 default 18 direct_packets_stat 0 direct_qlen 
1000
qdisc netem 8001: parent 1:12 limit 1000 delay 250.0ms

Now I was able to reproduce your case:
< 
* Operation timed out after 30000 milliseconds with 19618356 out of 59605116 
bytes received
* stopped the pause stream!
* Closing connection 0s [=========>                    ] 18.71MiB/56.84MiB

This is the 30 second timeout that is the default.


Per [1] I was setting the timeout to a higher value in 
/etc/clamav/freshclam.conf
ConnectTimeout 300
ReceiveTimeout 300

And then it worked again.
Fri Mar  6 10:38:41 2020 -> ClamAV update process started at Fri Mar  6 
10:38:41 2020
Fri Mar  6 10:38:41 2020 -> daily database available for download (remote 
version: 25742)
Time: 89.7s, ETA: 0.0s [=============================>] 56.84MiB/56.84MiB       
 
Fri Mar  6 10:40:13 2020 -> Testing database: 
'/var/lib/clamav/tmp.dea37/clamav-c6eff5dffb9adbb813b9a2d9d4646848.tmp-daily.cvd'
 ...
Fri Mar  6 10:40:21 2020 -> Database test passed.
Fri Mar  6 10:40:21 2020 -> daily.cvd updated (version: 25742, sigs: 2208177, 
f-level: 63, builder: raynman)
Fri Mar  6 10:40:21 2020 -> main database available for download (remote 
version: 59)
Time: 178.9s, ETA: 0.0s [=============================>] 112.40MiB/112.40MiB    
  
Fri Mar  6 10:43:23 2020 -> Testing database: 
'/var/lib/clamav/tmp.dea37/clamav-e3fe3307371296aac45e347158fa7efb.tmp-main.cvd'
 ...
Fri Mar  6 10:43:29 2020 -> Database test passed.
Fri Mar  6 10:43:29 2020 -> main.cvd updated (version: 59, sigs: 4564902, 
f-level: 60, builder: sigmgr)
Fri Mar  6 10:43:29 2020 -> bytecode database available for download (remote 
version: 331)
Time: 3.3s, ETA: 0.0s [=============================>] 289.44KiB/289.44KiB  


This is a local config issue when matched with a very slow internet connection.
The defaults are from upstream, so a discussion about bumping them for higher 
defaults would have to be there. But I think you are good just adapting your 
system as needed.

I found that a discussion about that default already happened and the default 
was set to 0 (no timeout) on the receive [2].
That change is rather new and we will pick it up naturally with the newer 
version.

But it is good to be aware as we will also have to change
  debian/clamav-freshclam.postinst.in
Which sets the old default of 30 still
  205   [ -z "$ConnectTimeout" ] && ConnectTimeout=30
  ...
  227 ConnectTimeout $ConnectTimeout

For now just change your local config.
But we should try to fix that before 20.04 is released in that new version 
(can't really wait on a new clamav). But we'd have to check if there are 
negative interactions first.

Adding it to the list of Ubuntu-server TODOs


[1]: https://linux.die.net/man/5/freshclam.conf
[2]: 
https://github.com/Cisco-Talos/clamav-devel/commit/2fd28e1d09f6a563564b61923e62338308e44466

** Changed in: clamav (Ubuntu)
       Status: New => Triaged

** Changed in: clamav (Ubuntu)
   Importance: Undecided => High

** Tags added: server-next

** Summary changed:

- clamav update failed
+ clamav update failed - default timeout needs a bump (upstream has bumped 
already)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1865818

Title:
  clamav update failed - default timeout needs a bump (upstream has
  bumped already)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/clamav/+bug/1865818/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to