[asterisk-users] Unknown connection error: (2006) MySQL server has gone away

Matt Riddell matt at venturevoip.com
Wed Aug 29 21:22:32 CDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Shaun Hofer wrote:
> Hi,
> I get the following after a call has finished:
> 
>    ERROR[6862]:mysql_log: cdr_mysql: Unknown connection error: (2006) 
> MySQL server has gone away
> 
> Does this error message only appear when asterisk makes a new connection 
> to mysql, because the old connection was stale (and dropped) ?

Correct.

> If so, is there a way to get asterisk to stop reporting this as an error 
> seeing it seems to write the CDR to database just fine ?

In my cdr_addon_mysql.c around line 160 there are the series of statements:

case CR_SERVER_LOST:
ast_log(LOG_ERROR, "cdr_mysql: Server has gone away. Attempting to
reconnect.\n");
break;

You can just comment out that line by putting // at the beginning of it.

I guess it should really be a debug message at that stage and then an
error further down:

ast_log(LOG_ERROR, "cdr_mysql: Retried to connect fives times, giving
up.\n");

Because it will retry 5 times and the "gone away" message is printed on
each of those times but doesn't necessarily indicate any problem (i.e.
stale connection).

- --
Kind Regards,

Matt Riddell
Director
_______________________________________________

http://www.venturevoip.com (Great new VoIP end to end solution)
http://www.venturevoip.com/news.php (Daily Asterisk News - html)
http://feeds.venturevoip.com/AsteriskNews (Daily Asterisk News - rss)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG1inoDQNt8rg0Kp4RArqhAJ9WfGJ9NvQwtxJn11HGi/FWMQvydwCdEtQ5
5kpz7xZ5FE8UAsii3l24mGQ=
=X1h1
-----END PGP SIGNATURE-----



More information about the asterisk-users mailing list