[Spce-user] Error in Kamailio trying to connect mysql

Mario Contreras mario.contreras at innovasur.es
Wed Dec 12 04:34:03 EST 2012


Hi all,

I have had an extrange issue with mysql. Kamailio couldn't connect. Here 
there are some lines from kamailio-proxy.log:

Dec 11 23:41:05 sip /usr/sbin/kamailio[32737]: ERROR: db_mysql 
[km_dbase.c:122]: driver error on query: Lost connection to MySQL server 
during query
Dec 11 23:41:05 sip /usr/sbin/kamailio[32737]: ERROR: <core> 
[db_query.c:312]: error while submitting query
Dec 11 23:41:05 sip /usr/sbin/kamailio[32737]: ERROR: usrloc 
[ucontact.c:732]: updating database failed
Dec 11 23:41:05 sip /usr/sbin/kamailio[32737]: ERROR: usrloc 
[ucontact.c:916]: failed to update database
Dec 11 23:41:05 sip /usr/sbin/kamailio[32737]: ERROR: registrar 
[save.c:731]: failed to update contact

And this appears in mysql.err:

------- TRX HAS BEEN WAITING 3 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 443 page no 343 n bits 208 index 
`account_contact_idx` of table `kamailio`.`location` trx id 1C16C5C 
lock_mode X locks rec but not gap waiting
------------------
TABLE LOCK table `kamailio`.`location` trx id 1C16C5C lock mode IX
RECORD LOCKS space id 443 page no 343 n bits 208 index 
`account_contact_idx` of table `kamailio`.`location` trx id 1C16C5C 
lock_mode X locks rec but not gap waiting
---TRANSACTION 1C16C56, ACTIVE (PREPARED) 4 sec, process no 1862, OS 
thread id 140325265155840
mysql tables in use 1, locked 1
8 lock struct(s), heap size 1248, 22 row lock(s), undo log entries 11
MySQL thread id 90793, query id 968315 localhost kamailio freeing items
update location set expires=............  --> This is a query for a 
registration

TABLE LOCK table `kamailio`.`location` trx id 1C16C56 lock mode IX
RECORD LOCKS space id 443 page no 346 n bits 208 index 
`account_contact_idx` of table `kamailio`.`location` trx id 1C16C56 
lock_mode X locks rec but not gap
RECORD LOCKS space id 443 page no 81 n bits 128 index `PRIMARY` of table 
`kamailio`.`location` trx id 1C16C56 lock_mode X locks rec but not gap
RECORD LOCKS space id 443 page no 92 n bits 128 index `PRIMARY` of table 
`kamailio`.`location` trx id 1C16C56 lock_mode X locks rec but not gap
RECORD LOCKS space id 443 page no 93 n bits 128 index `PRIMARY` of table 
`kamailio`.`location` trx id 1C16C56 lock_mode X locks rec but not gap
RECORD LOCKS space id 443 page no 94 n bits 128 index `PRIMARY` of table 
`kamailio`.`location` trx id 1C16C56 lock_mode X locks rec but not gap
RECORD LOCKS space id 443 page no 95 n bits 128 index `PRIMARY` of table 
`kamailio`.`location` trx id 1C16C56 lock_mode X locks rec but not gap
RECORD LOCKS space id 443 page no 96 n bits 96 index `PRIMARY` of table 
`kamailio`.`location` trx id 1C16C56 lock_mode X locks rec but not gap

Anyway, this problem has happened last night, but it's already solved(I 
didn't do anything...). Any clue about how I can prevent this?

Thanks!




More information about the Spce-user mailing list