NixUser

NixUser.com | Unix User | Linux User | NixUser

LibClamAV Error: Can’t load /usr/share/clamav/daily.cld: Malformed database

I was not able to restart clamd service, was getting the following error.

root@nixuser.com [/]# /etc/init.d/exim restart
Shutting down clamd:                                       [FAILED]
Shutting down exim:                                        [  OK  ]
Shutting down spamd:                                       [  OK  ]
Starting clamd: LibClamAV Error: cli_tgzload: Invalid checksum for file daily.mdb
LibClamAV Error: Can’t load /usr/share/clamav/daily.cld: Malformed database
ERROR: Malformed database
[FAILED]
Starting exim:                                             [  OK  ]
0 processes (antirelayd) sent signal 9
/usr/local/cpanel/scripts/update_sa_rules: running in background
root@nixuser.com [/]#

Freshclam command was not also working.

root@nixuser.com [/]# freshclam
ClamAV update process started at Thu Aug 22 04:28:34 2013
main.cvd is up to date (version: 54, sigs: 1044387, f-level: 60, builder: sven)
WARNING: getfile: Error while reading database from database.clamav.net (IP: 209.198.147.20): Connection reset by peer
WARNING: getpatch: Can’t download daily-17713.cdiff from database.clamav.net
Downloading daily-17713.cdiff [100%]
Downloading daily-17714.cdiff [100%]
Downloading daily-17715.cdiff [100%]
Downloading daily-17716.cdiff [100%]
Downloading daily-17717.cdiff [100%]
Downloading daily-17718.cdiff [100%]
Downloading daily-17719.cdiff [100%]
Downloading daily-17720.cdiff [100%]
ERROR: During database load : WARNING: [LibClamAV] cli_tgzload: Invalid checksum for file daily.mdb […] ERROR: Failed to load new database: Malformed database
WARNING: Database load exited with status 55
ERROR: Failed to load new database
root@nixuser.com [/]#

I had to rename the daily.cld file and ran freshclam again to fix it.

root@nixuser.com [~]# mv /usr/share/clamav/daily.cld /usr/share/clamav/daily.cld.bkp
root@nixuser.com [~]# freshclam
ClamAV update process started at Thu Aug 22 04:30:18 2013
main.cvd is up to date (version: 54, sigs: 1044387, f-level: 60, builder: sven)
nonblock_recv: recv timing out (30 secs)
WARNING: getfile: Download interrupted: Operation now in progress (IP: 194.186.47.19)
WARNING: Can’t download daily.cvd from database.clamav.net
Trying again in 5 secs…
ClamAV update process started at Thu Aug 22 04:32:34 2013
main.cvd is up to date (version: 54, sigs: 1044387, f-level: 60, builder: sven)
Downloading daily.cvd [100%]
daily.cvd updated (version: 17720, sigs: 1637555, f-level: 63, builder: neo)
Downloading bytecode-225.cdiff [100%]
bytecode.cld updated (version: 225, sigs: 42, f-level: 63, builder: dgoddard)
Database updated (2681984 signatures) from database.clamav.net (IP: 200.236.31.1)
root@nixuser.com [~]#

If freshclam fails or times out, stop the server firewall or whoitelist the IPs and try again. It should fix the error.