1

Topic: [SOLVED] Error amavis DBD::mysql::st execute failed:

==== Provide basic information to help troubleshoot ====
- iRedMail version: 0.7.2
- Linux/BSD distribution name and version: Debian x86_64 6.0.2
- Any related log? Log is helpful for troubleshooting.
====

Hi,

I was checking my log where I saw this error:

Oct 12 15:04:31 mail amavis[22655]: (22655-02) NOTICE: reconnecting in response to: err=2006, HY000, DBD::mysql::st execute failed: MySQL server has gone away at (eval 115) line 166, <GEN36> line 176.

What does it mean? How can I correct it?

Thanks for your help.

Regards,

Christophe

----

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

2

Re: [SOLVED] Error amavis DBD::mysql::st execute failed:

Seems your MySQL server is under heavy load, wasn't it?

Also, do you have "$max_requests" setting in Amavisd config file (/etc/amavis/conf.d/*)?
Reference: http://www.ijs.si/software/amavisd/amav … x_requests

If your server is not under heavy load, it's better to keep default value of "$max_requests".

3

Re: [SOLVED] Error amavis DBD::mysql::st execute failed:

Thanks for your help.

In fact, this server is actually sending 10 mails each day.

MySQL is very quiet ...

I'll adapt my config.

Regards,

Christophe

4

Re: [SOLVED] Error amavis DBD::mysql::st execute failed:

That's the problem, established MySQL connection timed out.

Try to add below lines in /etc/amavis/conf.d/50-users before the last line "1;", then restart Amavisd service:

$max_servers = 1;
$max_requests = 1;

5

Re: [SOLVED] Error amavis DBD::mysql::st execute failed:

Hi,

It's the good solution, many thanks for your help!!!

Christophe

6

Re: [SOLVED] Error amavis DBD::mysql::st execute failed:

Hi ZhangHuangbin!

What would be your advise to set this:

$max_servers = ?;
$max_requests = ?;

... for a mail server of 300 emails average a day ?

Thanks !

7

Re: [SOLVED] Error amavis DBD::mysql::st execute failed:

Hi digitalbit,

What's your current issue?

8

Re: [SOLVED] Error amavis DBD::mysql::st execute failed:

Got this on my logwatch this morning :


--------------------- Amavisd-new Begin ------------------------

       12   Clean passed                              75.00%
        4   Bad header passed                         25.00%
--------   ------------------------------------------------
       16   Total Messages Scanned                   100.00%
========   ================================================

       16   Ham                                      100.00%
--------   ------------------------------------------------
       16   Total Messages Scanned                   100.00%
========   ================================================

 
**Unmatched Entries**
        2   (25833-06) INFO: removed bare CR from 8 header line(s)
        2   (25833-07) INFO: removed bare CR from 8 header line(s)
        2   (25832-01) INFO: removed bare CR from 9 header line(s)
        2   (25832-07) INFO: removed bare CR from 8 header line(s)
        1   (23575-05) NOTICE: reconnecting in response to: err=2006, HY000, DBD::mysql::st execute failed: MySQL server has gone away at (eval 100) line 166, <GEN19> line 7742.
        1   (23576-04) NOTICE: reconnecting in response to: err=2006, HY000, DBD::mysql::st execute failed: MySQL server has gone away at (eval 100) line 166, <GEN19> line 9850.

---------------------- Amavisd-new End -------------------------

From Sunday (not much activity ~ 20 emails) compared with 250/300 emails on business days

... any tip ?

9

Re: [SOLVED] Error amavis DBD::mysql::st execute failed:

The connection to MySQL server initialized by Amavisd timed out, because you have too few emails. smile

Please decrease (or add) value of "max_connections" in /etc/mysql/my.cnf like below:

[mysqld]
...
set-variable = max_connections=512

If the same issue happened again, please try decreasing it again.

10

Re: [SOLVED] Error amavis DBD::mysql::st execute failed:

Thanks ZhangHuangbin wink

Set my /etc/my.cnf to:  max_connections=256

that will be enough for an average of 250/300 emails per day !

That error should be normal on weekends anyway !

Thanks for the tip !