Page 1 of 1

Missing events, "MySQL server has gone away" error

Posted: Mon Jul 02, 2007 7:41 am
by marshn
I have installed version 1.22.3 onto a Debian etch system using the package available in unstable.

The system has been regularly missing events, often the first of the day. The error messages in syslog are :

Jun 29 06:53:39 bammon zma_m3[10586]: ERR [Can't insert event: MySQL server has gone away]

This error appears to be due to the first mysql_query() in zm_events.cpp failing. On my installation I have been able to prevent these failures by increasing the mysql connection timeout dramatically. Adding a line in mysqld section of the my.cnf file, changing the wait_timeout value from the default of 28800 (eight hours) to 31536000 (one year) :

wait_timeout = 31536000

Whether this will have any undesirable side effects remains to be seen. Would a more proper solution be to retry this mysql_query() (and any others in the rest of the source) in the event of a timeout to reestablish the connection?

Regards, Neil

Posted: Fri Jul 06, 2007 12:54 am
by PeterHoward
I haven't seen that one . . . I'll see if I can repeat it (unfortunately my zm machine currently has a dead power supply so it won't be for a few days).

I gather from your comments that it doesn't miss all events; rather it works fine then, after a break, fail to connect to MySQL. Is that correct?