[SR-Users] db_mysql "Commands out of sync; you can't run this command now "

MÉSZÁROS Mihály misi at niif.hu
Mon Aug 29 17:12:50 CEST 2011


Hi,


I find the following:

grep "con: 17212"

Aug 29 17:05:27 hal /usr/sbin/kamailio[24001]: INFO: db_mysql 
[km_dbase.c:83]:  submit_query:  con: 17212  table: location  query: 
insert into location 
(username,contact,expires,q,callid,cseq,flags,cflags,user_agent,received,path,socket,methods,last_modified 
) values 
('de-tek-hpc','sip:de-tek-hpc at 193.6.138.201:5060;transport=tcp','2011-08-29 
17:10:27',-1.00     ,'966616894-1736',2,0,0,'Polycom HDX 8000 HD 
(Release - 
3.0.2.1-17007)',NULL,NULL,'tcp:195.111.192.7:5060',24575,'2011-08-29 
17:05:27')
Aug 29 17:05:27 hal /usr/sbin/kamailio[24001]: INFO: db_mysql 
[km_dbase.c:83]:  submit_query:  con: 17212  table: location  query: 
delete from location where username='de-tek-hpc'
Aug 29 17:05:30 hal /usr/sbin/kamailio[24002]: INFO: db_mysql 
[km_dbase.c:83]:  submit_query:  con: 17212  table: location  query: 
select 
contact,expires,q,callid,cseq,flags,cflags,user_agent,received,path,socket,methods,last_modified 
from location where username='me-iit' order by q
Aug 29 17:05:30 hal /usr/sbin/kamailio[24002]: INFO: db_mysql 
[km_dbase.c:175]: store_result:  con: 17212  table: location
Aug 29 17:05:30 hal /usr/sbin/kamailio[24002]: INFO: db_mysql 
[km_dbase.c:83]:  submit_query:  con: 17212  table: location  query: 
update location set expires='2011-08-29 17:10:30',q=-1.00     
,cseq=3,flags=0,cflags=0,user_agent='Polycom HDX 8000 HD (Release - 
3.0.2.1-17007)',received=NULL,path=NULL,socket='tcp:195.111.192.7:5060',methods=NULL,last_modified='2011-08-29 
17:05:30' where username='me-iit' AND 
contact='sip:me-iit at 193.6.5.220:5060;transport=tcp' AND 
callid='385875516-1729'
Aug 29 17:05:37 hal /usr/sbin/kamailio[24003]: INFO: db_mysql 
[km_dbase.c:83]:  submit_query:  con: 17212  table: location  query: 
select 
contact,expires,q,callid,cseq,flags,cflags,user_agent,received,path,socket,methods,last_modified 
from location where username='de-tek-hpc' order by q
Aug 29 17:05:37 hal /usr/sbin/kamailio[24003]: INFO: db_mysql 
[km_dbase.c:83]:  submit_query:  con: 17212  table: location  query: 
insert into location 
(username,contact,expires,q,callid,cseq,flags,cflags,user_agent,received,path,socket,methods,last_modified 
) values 
('de-tek-hpc','sip:de-tek-hpc at 193.6.138.201:5060;transport=tcp','2011-08-29 
17:10:37',-1.00     ,'976693266-1736',2,0,0,'Polycom HDX 8000 HD 
(Release - 
3.0.2.1-17007)',NULL,NULL,'tcp:195.111.192.7:5060',24575,'2011-08-29 
17:05:37')
Aug 29 17:05:37 hal /usr/sbin/kamailio[24003]: INFO: db_mysql 
[km_dbase.c:83]:  submit_query:  con: 17212  table: location  query: 
delete from location where username='de-tek-hpc'
Aug 29 17:05:47 hal /usr/sbin/kamailio[24004]: INFO: db_mysql 
[km_dbase.c:83]:  submit_query:  con: 17212  table: location  query: 
select 
contact,expires,q,callid,cseq,flags,cflags,user_agent,received,path,socket,methods,last_modified 
from location where username='de-tek-hpc' order by q
Aug 29 17:05:47 hal /usr/sbin/kamailio[24004]: INFO: db_mysql 
[km_dbase.c:175]: store_result:  con: 17212  table: location
Aug 29 17:05:47 hal /usr/sbin/kamailio[24004]: INFO: db_mysql 
[km_dbase.c:83]:  submit_query:  con: 17212  table: location  query: 
update location set expires='2011-08-29 17:10:47',q=-1.00     
,cseq=2,flags=0,cflags=0,user_agent='Polycom HDX 8000 HD (Release - 
3.0.2.1-17007)',received=NULL,path=NULL,socket='tcp:195.111.192.7:5060',methods=24575,last_modified='2011-08-29 
17:05:47' where username='de-tek-hpc' AND 
contact='sip:de-tek-hpc at 193.6.138.201:5060;transport=tcp' AND 
callid='385871516-1736'


a full log piece:

Aug 29 17:10:16 hal /usr/sbin/kamailio[24003]: INFO: db_mysql 
[km_dbase.c:83]:  submit_query:  con: 17212  table: location  query: 
select c
ontact,expires,q,callid,cseq,flags,cflags,user_agent,received,path,socket,methods,last_modified 
from location where username='ppke-vjk' ord
er by q
Aug 29 17:10:16 hal /usr/sbin/kamailio[24003]: ERROR: db_mysql 
[km_dbase.c:129]: driver error on query: Commands out of sync; you can't run
  this command now
Aug 29 17:10:16 hal /usr/sbin/kamailio[24003]: ERROR: <core> 
[db_query.c:103]: error while submitting query
Aug 29 17:10:16 hal /usr/sbin/kamailio[24003]: ERROR: usrloc 
[udomain.c:570]: db_query failed
Aug 29 17:10:16 hal /usr/sbin/kamailio[24003]: INFO: db_mysql 
[km_dbase.c:83]:  submit_query:  con: 17212  table: location  query: 
insert i
nto location 
(username,contact,expires,q,callid,cseq,flags,cflags,user_agent,received,path,socket,methods,last_modified 
) values ('ppke-vjk
','sip:ppke-vjk at 193.225.195.133:5061;transport=tls','2011-08-29 
17:15:16',-1.00     ,'1254092986-1737',2,0,0,'Polycom HDX 8000 HD (Release
- 3.0.2.1-17007)',NULL,NULL,'tls:195.111.192.7:5061',24575,'2011-08-29 
17:10:16')
Aug 29 17:10:16 hal /usr/sbin/kamailio[24003]: ERROR: db_mysql 
[km_dbase.c:129]: driver error on query: Commands out of sync; you can't run
  this command now
Aug 29 17:10:16 hal /usr/sbin/kamailio[24003]: ERROR: <core> 
[db_query.c:186]: error while submitting query
Aug 29 17:10:16 hal /usr/sbin/kamailio[24003]: ERROR: usrloc 
[ucontact.c:513]: inserting contact in db failed
Aug 29 17:10:16 hal /usr/sbin/kamailio[24003]: ERROR: usrloc 
[urecord.c:474]: failed to insert in database
Aug 29 17:10:16 hal /usr/sbin/kamailio[24003]: ERROR: registrar 
[save.c:430]: failed to insert contact
Aug 29 17:10:16 hal /usr/sbin/kamailio[24003]: INFO: db_mysql 
[km_dbase.c:83]:  submit_query:  con: 17212  table: location  query: 
delete f
rom location where username='ppke-vjk'
Aug 29 17:10:16 hal /usr/sbin/kamailio[24003]: ERROR: db_mysql 
[km_dbase.c:129]: driver error on query: Commands out of sync; you can't run
  this command now
Aug 29 17:10:16 hal /usr/sbin/kamailio[24003]: ERROR: <core> 
[db_query.c:242]: error while submitting query
Aug 29 17:10:16 hal /usr/sbin/kamailio[24003]: ERROR: usrloc 
[urecord.c:426]: failed to delete from database
Aug 29 17:10:16 hal /usr/sbin/kamailio[24003]: ERROR: usrloc 
[udomain.c:896]: DB delete failed

Thanks,
Misi

(I don't know may be matter, and i didn't mentioned yet, that i am 
running multiple kamaillio instance on different ip address but on the 
same machine.)


2011-08-29 14:00 keltezéssel, Alex Hermann írta:
> On Monday 29 August 2011, MÉSZÁROS Mihály wrote:
>> I am experiencing that in usrloc module, still more then one worker
>> process share the same sql connection:
>
> I'm sorry, the first patch was totally bogus. Due to the forking of the
> childs, they have the same memory layout and a very high chance of allocating
> the same address (in their own address space) for the connection struct.
>
> Attached patch should give a thread_id truly unique per connection. If you're
> able to find multiple processes using the same thread_id, you've found the
> cause.




More information about the sr-users mailing list