[SR-Users] Lost connection to MySQL server during query

Daniel-Constantin Mierla miconda at gmail.com
Thu Mar 28 21:50:20 CET 2019


Hello,

iirc, a while ago I had similar errors, that happened because the stored
procedure took too long to execute, due to the fact that the acc or cdrs
tables had a lot of records. If that is the case, you should move old
processed records to a different table or delete them if they are no
longer needed.

Cheers,
Daniel

On 28.03.19 18:42, JR Richardson wrote:
> Hey Folks,
>
> Getting some annoying logs, pretty certain these are false positives.
> I'm running kamailio 4.4.7 using localhost mysql 5.5.60 on debian
> 7.11. Pretty simple setup, have acc and collecting cdrs. Relevant
> kamailio.cfg:
>
> loadmodule "acc.so"
> loadmodule "rtimer.so"
> loadmodule "sqlops.so"
>
> # -----  acc params -----
> modparam("acc", "db_url", DBURLRW)
> modparam("acc", "db_flag", 1)
> modparam("acc", "db_missed_flag", 2)
> modparam("acc", "db_extra",
>         "src_user=$fU;src_domain=$fd;src_ip=$si;"
>         "dst_ouser=$tU;dst_user=$rU;dst_domain=$rd;"
>         "accountcode=$avp(s:acctcode)")
> modparam("rtimer", "timer", "name=cdr;interval=300;mode=1;")
> modparam("rtimer", "exec", "timer=cdr;route=CDRS")
> modparam("sqlops", "sqlcon", "cb=>mysql://rwuser:rwpass@localhost/kamailio")
>
> route[CDRS] {
>         sql_query("cb","call kamailio_cdrs()","rb");
> }
>
> Logs:
> ERROR: db_mysql [km_dbase.c:128]: db_mysql_submit_query(): driver
> error on query: Lost connection to MySQL server during query (2013)
> ERROR: <core> [db_query.c:181]: db_do_raw_query(): error while submitting query
> ERROR: sqlops [sql_api.c:265]: sql_do_query(): cannot do the query
> [call kamailio_cdrs()]
>
> CDRs are working fine, no issues with the results, just the log
> messages. Errors occur every 5 minutes so this is related to the
> rtimer cycle, mode=1 is set for new connection so there really
> wouldn't be a lost connection, the old connection should have been
> relieved on last cycle.
>
> I've seen some other post talking about this issue but could not find
> any resolution or work around. Any help is appreciated.
>
> Thanks.
>
> JR

-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 6-8, 2019 -- www.kamailioworld.com




More information about the sr-users mailing list