<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks for your ideas Henning, will investigate further.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Best,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
/Tobias</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Henning Westerholt <hw@kamailio.org><br>
<b>Sent:</b> Monday, June 18, 2018 9:50 PM<br>
<b>To:</b> Tobias Lindgren<br>
<b>Cc:</b> Kamailio (SER) - Users Mailing List<br>
<b>Subject:</b> Re: [SR-Users] Timer child process loosing MySQL connections</font>
<div> </div>
</div>
<meta content="text/html; charset=us-ascii">
<meta name="x_qrichtext" content="1">
<style type="text/css">
<!--
p, li
        {white-space:pre-wrap}
-->
</style>
<div style="font-family:'Hack'; font-size:9pt; font-weight:400; font-style:normal">
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
Am Montag, 18. Juni 2018, 11:15:43 CEST schrieb Tobias Lindgren:</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
> So I went with your suggestion to start a new Kamailio with just a few</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
> childs. Got the same issue after running for some time (again, with the</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
> timer process): </p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
> Jun 18 10:19:36 /usr/sbin/kamailio[25582]: DEBUG:</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
> db_cluster [dbcl_api.c:370]: db_cluster_raw_query(): executing db cluster</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
> raw query command Jun 18 10:19:36 /usr/sbin/kamailio[25582]: DEBUG:</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
> db_cluster [dbcl_api.c:371]: db_cluster_raw_query(): serial operation -</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
> cluster [k1] (9/0) Jun 18 10:19:36 /usr/sbin/kamailio[25582]: ERROR:</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
> db_mysql [km_dbase.c:128]: db_mysql_submit_query(): driver error on query:</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
> Lost connection to MySQL server at 'waiting for initial communication</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
> packet', system error: 4 (2013) Jun 18 10:19:36 /usr/sbin/kamailio[25582]:</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
> ERROR: <core> [db_query.c:181]: db_do_raw_query(): error while submitting</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
> query Jun 18 10:19:36 /usr/sbin/kamailio[25582]: DEBUG: db_cluster</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
> [dbcl_api.c:371]: db_cluster_raw_query(): serial operation - failre on</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
> cluster [k1] (9/0) Jun 18 10:19:36 /usr/sbin/kamailio[25582]: DEBUG:</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
> db_cluster [dbcl_api.c:371]: db_cluster_raw_query(): serial operation -</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
> cluster [k1] (1/0)</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
> </p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
> Not really sure how perform a good debug beyond this point, any suggestions?</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
 </p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
Hello Tobias,</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
 </p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
I see. Regarding further debugging - not sure if this is easy feasible - what about just connecting the "debug" kamailio directly to the database without the firewall? If you still loosing connections in this setup, I would investigate the situation further
 on your side.</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
 </p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
Do you use SSL? There has been a lengthy discussion with a similar issue at:</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
https://github.com/kamailio/kamailio/issues/406</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
 </p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
It could be also something related to a machine with several network interfaces:</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
https://lists.kamailio.org/pipermail/sr-users/2015-October/090266.html</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
 </p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
If this path does not bring you closer to a solution, I would try the debug kamailio against a different (maybe fresh installed) isolated database. Then I would try move the debug kamailio on a different (maybe fresh installed) machine. Basically just changing
 one thing at a time until the issue stops.</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
 </p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
Another option would be to capture the TCP traffic of the debug kamailio against the database and look for strange things in the wireshark.</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
 </p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
Best regards,</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
 </p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
Henning</p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
 </p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
 </p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
-- </p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; text-indent:0px">
If you like my work in the Kamailio project, it would be great if you could consider supporting me on Patreon: https://www.patreon.com/henningw</p>
</div>
</body>
</html>