[SR-Users] MySql Deadlock errors in Presence updates but db_mode set to 0

paul at irishvoip.com paul at irishvoip.com
Fri Mar 8 14:54:48 CET 2019

Hi there 

My config is a primary:secondary DNS srv failover Kamailio 5.2 setup using DMQ for syncing Location, Presence, HTable etc. 

For Presence db_mode set to 0 on both servers. 

This works fine on the primary server but on the secondary server I get repeated mysql deadlock errors. I seem to be missing a config setting to turn off db_mode fully for presence but I cant see where. Error seems to occur on message-summary updates from master that are being replicated to slave via DMQ. 

Mar 08 13:52:39 /usr/sbin/kamailio[17493]: ERROR: <core> [db_query.c:181]: db_do_raw_query(): error while submitting query 
Mar 08 13:52:39 /usr/sbin/kamailio[17493]: ERROR: db_mysql [km_dbase.c:714]: db_mysql_end_transaction(): executing raw_query 
Mar 08 13:52:39 /usr/sbin/kamailio[17493]: ERROR: presence [presentity.c:1299]: update_presentity(): in end_transaction 
Mar 08 13:52:40 /usr/sbin/kamailio[17493]: ERROR: db_mysql [km_dbase.c:128]: db_mysql_submit_query(): driver error on query: Deadlock found when trying to get lock; try restarting transaction (1213) 

I am using the following presence related modules 

loadmodule "presence.so" 
loadmodule "presence_mwi.so" 
loadmodule "presence_xml.so" 
loadmodule "pua.so" 
loadmodule "rls.so" 
loadmodule "xcap_server.so" 
loadmodule "xcap_client.so" 

params are set as below 

loadmodule "presence.so" 
loadmodule "presence_mwi.so" 
loadmodule "presence_xml.so" 
loadmodule "pua.so" 
loadmodule "rls.so" 
loadmodule "xcap_server.so" 
loadmodule "xcap_client.so" 

params are set as below with PRESENCEDBMODE set to 0 on both servers. 

# ----- presence params ----- 
modparam("presence", "db_url", DBURL) 
modparam("presence", "db_update_period", 5) 
modparam("presence", "server_address", "sip:myserver.com") 
modparam("presence", "subs_db_mode", PRESENCEDBMODE) 
modparam("presence", "send_fast_notify", 1) 
modparam("presence", "timeout_rm_subs", 0) 
modparam("presence", "db_table_lock_type", 0) 
modparam("presence", "notifier_processes", 3) 
modparam("presence", "local_log_level", 3) 
modparam("presence", "publ_cache", 1) 
#!ifdef WITH_DMQ 
modparam("presence", "enable_dmq", 1) 
modparam("presence", "enable_dmq", 0) 

#!ifdef WITH_BUDDY 
# ----- presence_xml params ----- 
modparam("presence_xml", "db_url", DBURL) 
modparam("presence_xml", "passive_mode", 1) 
modparam("presence_xml", "integrated_xcap_server", 1) 
modparam("presence_xml", "xcap_server", "https://xcap.myserver.com/xcap-root") 
modparam("presence_xml", "force_dummy_presence", 1) 
modparam("pua", "db_url", DBURL) 
modparam("pua", "db_mode", PRESENCEDBMODE) 
modparam("pua", "db_table_lock_write", 0) 
modparam("pua", "check_remote_contact", 0) 

modparam("rls", "db_url", DBURL) 
modparam("rls", "db_mode", PRESENCEDBMODE) 
modparam("rls", "notifier_processes", 2) 
modparam("rls", "integrated_xcap_server", 1) 
modparam("rls", "xcap_root", "https://xcap.myserver.com/xcap-root") 
modparam("rls", "server_address", "sip:rls at myserver.com") 
modparam("rls", "outbound_proxy", "sip:myserver.com") 
modparam("rls", "disable_remote_presence", 0) 
modparam("rls", "max_backend_subs", 1000) 
modparam("rls", "to_presence_code", 10) 
modparam("rls", "rls_event", "presence") 
modparam("rls", "rls_event", "presence.winfo") 
modparam("xcap_server", "db_url", DBURL) 
modparam("xcap_server", "directory_scheme", -1) 
modparam("xcap_server", "xcap_root", "/xcap-root/") 
modparam("xcap_client", "db_url", DBURL) 
modparam("xcap_client", "query_period", 50) 

Any ideas? 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20190308/819a8ec5/attachment.html>

More information about the sr-users mailing list