1 (edited by koevoetje 2013-10-28 09:01:47)

Topic: Clamd: Segmentationfault/Malformed database -> e-mail delays

==== Required information ====
- iRedMail version: 0.8.5
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):MySQL
- Linux/BSD distribution name and version: CentOS 6.4 x64
- Related log if you're reporting an issue:
====


My mailserver has delays in sending/receiving e-mails. Checked the logs and encountered the following:

/var/log/maillog

Oct 27 03:41:13 mail amavis[2240]: (02240-05) (!)connect to /tmp/clamd.socket failed, attempt #1: Can't connect to UNIX socket /tmp/clamd.socket: Verbinding is geweigerd
Oct 27 03:41:13 mail amavis[2240]: (02240-05) (!)ClamAV-clamd av-scanner FAILED: run_av error: Too many retries to talk to /tmp/clamd.socket (All attempts (1) failed connecting $
Oct 27 03:41:13 mail amavis[2240]: (02240-05) (!)WARN: all primary virus scanners failed, considering backups
Oct 27 03:41:14 mail amavis[2241]: (02241-05) (!)connect to /tmp/clamd.socket failed, attempt #1: Can't connect to UNIX socket /tmp/clamd.socket: Verbinding is geweigerd
Oct 27 03:41:14 mail amavis[2241]: (02241-05) (!)ClamAV-clamd av-scanner FAILED: run_av error: Too many retries to talk to /tmp/clamd.socket (All attempts (1) failed connecting $
Oct 27 03:41:14 mail amavis[2241]: (02241-05) (!)WARN: all primary virus scanners failed, considering backups
Oct 27 03:41:18 mail amavis[2240]: (02240-05) (!)ClamAV-clamscan av-scanner FAILED: /usr/bin/clamscan DIED, signal 11 (008b) at (eval 115) line 897.
Oct 27 03:41:18 mail amavis[2240]: (02240-05) (!!)AV: ALL VIRUS SCANNERS FAILED
Oct 27 03:41:18 mail amavis[2241]: (02241-05) (!)ClamAV-clamscan av-scanner FAILED: /usr/bin/clamscan DIED, signal 11 (008b) at (eval 115) line 897.
Oct 27 03:41:18 mail amavis[2241]: (02241-05) (!!)AV: ALL VIRUS SCANNERS FAILED

/var/log/clamav/freshclam.log-20131027

ClamAV update process started at Sun Oct 27 03:41:07 2013
main.cvd is up to date (version: 55, sigs: 2424225, f-level: 60, builder: neo)
Downloading daily-18014.cdiff [100%]
Downloading daily-18015.cdiff [100%]
Downloading daily-18016.cdiff [100%]
Downloading daily-18017.cdiff [100%]
WARNING: [LibClamAV] cli_loadhash: Invalid value for the size field
WARNING: [LibClamAV] cli_loadhash: Problem parsing database at line 303578
WARNING: [LibClamAV] Can't load daily.mdb: Malformed database
WARNING: [LibClamAV] cli_tgzload: Can't load daily.mdb
WARNING: [LibClamAV] Can't load /var/lib/clamav/clamav-1df775b2b9bf46a0680580f75bc51819.tmp/clamav-f3294835893a1550cb5792a0995b80c5$
ERROR: Failed to load new database: Malformed database
ERROR: During database load : ERROR: Failed to load new database: Malformed database
WARNING: Database load exited with status 55
ERROR: Failed to load new database

Service clamd start gave me the following error:

Service clamd start
Starting Clam AntiVirus Daemon: /bin/bash: rule 1:  4835 Segmentationfault       clamd  [FAILED]

Then I tried the following:

freshclam

ClamAV update process started at Mon Oct 28 01:45:48 2013
main.cvd is up to date (version: 55, sigs: 2424225, f-level: 60, builder: neo)
Downloading daily-18014.cdiff [100%]
Downloading daily-18015.cdiff [100%]
Downloading daily-18016.cdiff [100%]
Downloading daily-18017.cdiff [100%]
Downloading daily-18018.cdiff [100%]
Downloading daily-18019.cdiff [100%]
Downloading daily-18020.cdiff [100%]
Downloading daily-18021.cdiff [100%]
Downloading daily-18022.cdiff [100%]
Downloading daily-18023.cdiff [100%]
ERROR: During database load : WARNING: [LibClamAV] hm_addhash_str: invalid hash 690c99ca2b345c2bd522db36acaff58 [...] ERROR: Failed to load new database: Malformed database
WARNING: Database load exited with status 55
ERROR: Failed to load new database

Hope to get a solution for this problem.
Thanks in advance.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Clamd: Segmentationfault/Malformed database -> e-mail delays

ClamAV cannot start. Please try below steps:

*) Remove all files under /var/lib/clamav/.
*) Execute "freshclam" again.
*) Start ClamAV after freshclam finished.

3 (edited by koevoetje 2013-10-28 11:11:24)

Re: Clamd: Segmentationfault/Malformed database -> e-mail delays

Really strange:

ClamAV update process started at Mon Oct 28 03:51:58 2013
Downloading main.cvd [100%]
ERROR: Verification: Can't verify database integrity
Trying again in 5 secs...
ClamAV update process started at Mon Oct 28 03:52:11 2013
Downloading main.cvd [100%]
ERROR: During database load : WARNING: [LibClamAV] Can't load /var/lib/clamav/clamav-45c8b707d0a86046e1cf7b34fa633736.tmp/clamav-a18dfbe4ee216eccf9b3c3694b9413dc.cvd: Can't verify database integrity [...] ERROR: Failed to load new database: Can't verify database integrity
WARNING: Database load exited with status 55
ERROR: Failed to load new database
[root@mail clamav]# ls
mirrors.dat
[root@mail clamav]# service clamd status
clamd is gestopt
[root@mail clamav]# service clamd start
Starting Clam AntiVirus Daemon: LibClamAV Error: cli_loaddb(): No supported database files found in /var/lib/clamav
ERROR: Can't open file or directory
                                                           [MISLUKT]
[root@mail clamav]# freshclam
ClamAV update process started at Mon Oct 28 03:55:01 2013
Downloading main.cvd [100%]
WARNING: [LibClamAV] cli_tgzload: Invalid checksum for file main.mdb
ERROR: Verification: Malformed database
Trying again in 5 secs...
ClamAV update process started at Mon Oct 28 03:55:17 2013
Downloading main.cvd [100%]
WARNING: [LibClamAV] cli_tgzload: Invalid checksum for file main.ndb
ERROR: Verification: Malformed database
Trying again in 5 secs...
ClamAV update process started at Mon Oct 28 03:55:32 2013
Downloading main.cvd [100%]
ERROR: During database load : WARNING: [LibClamAV] hm_addhash_str: invalid hash d3273514a1dfa7910e4189522b1d87d -- FIXME! [...] ERROR: Failed to load new database: Malformed database
WARNING: Database load exited with status 55
ERROR: Failed to load new database

Removed the files another time:

freshclam
ClamAV update process started at Mon Oct 28 04:03:18 2013
Downloading main.cvd [100%]
ERROR: During database load : WARNING: [LibClamAV] Can't load /var/lib/clamav/cl               
amav-b159b5086eee05d9b133a60bb3d12f8b.tmp/clamav-7c2a83df2f364a3a68c551ab5f87dce     
b.cvd: Can't verify database integrity [...] ERROR: Failed to load new database:                  Can't verify database integrity
WARNING: Database load exited with status 55
ERROR: Failed to load new database

Any other ideas? Thank you.

4

Re: Clamd: Segmentationfault/Malformed database -> e-mail delays

Which mirror site do you use in /etc/clamd.conf?

5 (edited by koevoetje 2013-10-29 09:34:05)

Re: Clamd: Segmentationfault/Malformed database -> e-mail delays

You mean in /etc/freshclam.conf?

I found the following lines:

DatabaseMirror db.nl.clamav.net
DatabaseMirror db.local.clamav.net

Update1: Also tried some other mirrors. (DatabaseMirror db.us.clamav.net)
Same errors.

Update2: I decided to download the files manually, ran freshclam and got the following results:

ClamAV update process started at Mon Oct 28 20:45:11 2013
main.cvd is up to date (version: 55, sigs: 2424225, f-level: 60, builder: neo)
daily.cvd is up to date (version: 18028, sigs: 439181, f-level: 63, builder: neo)
bytecode.cvd is up to date (version: 228, sigs: 43, f-level: 63, builder: neo)

Tried to start clamd

service clamd start
Starting Clam AntiVirus Daemon: LibClamAV Error: hm_addhash_str: invalid hash 260c1691984 -- FIXME!
LibClamAV Error: cli_loadhash: Malformed hash string at line 55544
LibClamAV Error: cli_loadhash: Problem parsing database at line 55544
LibClamAV Error: Can't load daily.mdb: Invalid argument passed to function
LibClamAV Error: cli_tgzload: Can't load daily.mdb
LibClamAV Error: Can't load /var/lib/clamav/daily.cvd: Malformed database
ERROR: Malformed database
                                                           [FAILED]

Edit 3: Friend of mine gave his working clamav/libs. Still getting errors.

service clamd start
Starting Clam AntiVirus Daemon: LibClamAV Error: cli_loadhash: Invalid value for the size field
LibClamAV Error: cli_loadhash: Problem parsing database at line 77
LibClamAV Error: Can't load daily.hdb: Malformed database
LibClamAV Error: cli_tgzload: Can't load daily.hdb
LibClamAV Error: Can't load /var/lib/clamav/daily.cvd: Malformed database
ERROR: Malformed database

Any ideas what I should try to get this to work?

6

Re: Clamd: Segmentationfault/Malformed database -> e-mail delays

No idea at all. I suggest you post this issue in ClamAV mailing list instead.
http://www.clamav.net/lang/en/ml