<div dir="ltr">Hello Daniel, <div><br></div><div>I built from master and re-tested, debug log:</div><div><br></div><div>Feb 24 13:58:46 csbc02 csbc[9280]: DEBUG: <core> [core/socket_info.c:635]: grep_sock_info(): checking if port 5060 (advertise 0) matches port 5060<br>Feb 24 13:58:46 csbc02 csbc[9280]: DEBUG: dmq_usrloc [usrloc_sync.c:423]: usrloc_dmq_execute_action(): Received DMQ_UPDATE. Update contact info...<br>Feb 24 13:58:46 csbc02 csbc[9280]: DEBUG: dmq_usrloc [usrloc_sync.c:75]: add_contact(): aor: 1000107<br>Feb 24 13:58:46 csbc02 csbc[9280]: DEBUG: dmq_usrloc [usrloc_sync.c:76]: add_contact(): ci->ruid: uloc-2-5e507d6a-1bd5-3<br>Feb 24 13:58:46 csbc02 csbc[9280]: DEBUG: dmq_usrloc [usrloc_sync.c:77]: add_contact(): aorhash: 928379112<br>Feb 24 13:58:46 csbc02 csbc[9280]: DEBUG: dmq_usrloc [usrloc_sync.c:115]: add_contact(): '1000107' Not found in usrloc<br>Feb 24 13:58:46 csbc02 csbc[9280]: DEBUG: dmq_usrloc [usrloc_sync.c:117]: add_contact(): Insert record<br>Feb 24 13:58:46 csbc02 csbc[9280]: DEBUG: usrloc [ul_callback.h:83]: run_ul_callbacks(): contact=0x7f3a8cfdf170, callback type 1/15, id 0 entered<br>Feb 24 13:58:46 csbc02 csbc[9280]: DEBUG: dmq_usrloc [usrloc_sync.c:800]: dmq_ul_cb_contact(): Callback from usrloc with type=1<br>Feb 24 13:58:46 csbc02 csbc[9280]: DEBUG: dmq_usrloc [usrloc_sync.c:826]: dmq_ul_cb_contact(): Contact received from DMQ... skip<br>Feb 24 13:58:46 csbc02 csbc[9280]: ERROR: <core> [db.c:481]: db_use_table(): invalid parameter value<br>Feb 24 13:58:46 csbc02 csbc[9280]: ERROR: usrloc [ucontact.c:670]: db_insert_ucontact(): sql use_table failed for: location<br>Feb 24 13:58:46 csbc02 csbc[9280]: ERROR: usrloc [urecord.c:598]: insert_ucontact(): failed to insert in database<br>Feb 24 13:58:46 csbc02 csbc[9280]: DEBUG: dmq_usrloc [usrloc_sync.c:121]: add_contact(): Insert ucontact<br>Feb 24 13:58:46 csbc02 csbc[9280]: DEBUG: dmq_usrloc [usrloc_sync.c:124]: add_contact(): Release record<br>Feb 24 13:58:46 csbc02 csbc[9280]: DEBUG: dmq_usrloc [usrloc_sync.c:126]: add_contact(): Unlock udomain<br>Feb 24 13:58:46 csbc02 csbc[9280]: DEBUG: sl [sl.c:305]: send_reply(): reply in stateless mode (sl)<br>Feb 24 13:58:46 csbc02 csbc[9280]: DEBUG: <core> [core/msg_translator.c:161]: check_via_address(): (10.2.1.181, 10.2.1.181, 0)<br>Feb 24 13:58:46 csbc02 csbc[9280]: DEBUG: dialog [dlg_cseq.c:116]: dlg_cseq_prepare_new_msg(): prepare new msg for cseq update operations<br>Feb 24 13:58:46 csbc02 csbc[9280]: DEBUG: <core> [core/parser/msg_parser.c:620]: parse_msg(): SIP Reply (status):<br>Feb 24 13:58:46 csbc02 csbc[9280]: DEBUG: <core> [core/parser/msg_parser.c:622]: parse_msg(): version: <SIP/2.0><br>Feb 24 13:58:46 csbc02 csbc[9280]: DEBUG: <core> [core/parser/msg_parser.c:624]: parse_msg(): status: <200><br>Feb 24 13:58:46 csbc02 csbc[9280]: DEBUG: <core> [core/parser/msg_parser.c:626]: parse_msg(): reason: <OK><br></div><div><br></div><div><br></div><div><br></div><div>Thanks, </div><div>Joel.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 24, 2020 at 1:36 AM Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>Hello,</p>
<p>the error message:</p>
<p>Feb 21 00:11:25 csbc02 csbc[13916]: ERROR: <core>
[db.c:481]: db_use_table(): invalid parameter value</p>
<p>Is printed if the database table name is not given as parameter
(eg, null or empty). I pushed a patch to usrloc to print the table
in the log message, can you try with latest master (or patch from
next commit) and send again the log messages?</p>
<p> *
<a href="https://github.com/kamailio/kamailio/commit/3843ae18599bfc1806ccb62df44bbc8ad41d60dd" target="_blank">https://github.com/kamailio/kamailio/commit/3843ae18599bfc1806ccb62df44bbc8ad41d60dd</a></p>
<p>Cheers,<br>
Daniel<br>
</p>
<div>On 21.02.20 22:40, Joel Serrano wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hello,
<div><br>
</div>
<div>
<div>I have a setup with 2 kamailio in active/idle, locations
are shared via dmq_usrloc, but database is also used as a
cache where other systems can access and query "real-time"
data.</div>
<div><br>
</div>
<div>The config we have is:</div>
<div><br>
</div>
<div># ----- usrloc params -----<br>
modparam("usrloc", "db_url", DBURL)<br>
modparam("usrloc", "db_mode", 1)<br>
modparam("usrloc", "db_load", 0)<br>
modparam("usrloc", "db_insert_update", 1)<br>
modparam("usrloc", "db_timer_clean", 1)<br>
modparam("usrloc", "server_id_filter", 1)<br>
modparam("usrloc", "timer_procs", 2)<br>
modparam("usrloc", "timer_interval", 60)<br>
</div>
<div><br>
</div>
<div># ----- dmq_usrloc params -----<br>
modparam("dmq_usrloc", "enable", 1)<br>
modparam("dmq_usrloc", "sync", 1)<br>
modparam("dmq_usrloc", "batch_msg_contacts", 50) # 50
contacts / message<br>
modparam("dmq_usrloc", "batch_size", 10000) # 10000
contacts / batch<br>
modparam("dmq_usrloc", "batch_usleep", 500000) # one
batch every 500ms<br>
</div>
<div><br>
</div>
<div>With this setup, we assume:</div>
<div><br>
</div>
<div>1- almost real-time updated location info in the
database.</div>
<div>2- as long as one of the two Kam is up, location
information will not be lost (as they will sync with each
other via DMQ)</div>
<div>3- if both servers go down, locations are lost (as they
will not reload from database on startup).</div>
<div><br>
</div>
<div>Our tests work well with the above config, with one
exception, on the idle node, we see a lot of (only happens
on the node receiving location via dmq):</div>
<div><br>
</div>
<div>Feb 21 00:11:25 csbc02 csbc[13916]: ERROR: <core>
[db.c:481]: db_use_table(): invalid parameter value<br>
Feb 21 00:11:25 csbc02 csbc[13916]: ERROR: usrloc
[ucontact.c:1136]: db_update_ucontact_ruid(): sql use_table
failed<br>
Feb 21 00:11:25 csbc02 csbc[13916]: ERROR: usrloc
[ucontact.c:1657]: update_contact_db(): failed to update
database</div>
<div><br>
</div>
<div>I added debug logs to see if I could understand the
reason:</div>
<div><br>
</div>
<div>Feb 21 14:38:34 csbc02 csbc[30796]: DEBUG: dmq_usrloc
[usrloc_sync.c:478]: usrloc_dmq_handle_msg(): dmq message
received from <a href="http://sip:usrloc@10.2.1.181:5050" target="_blank">sip:usrloc@10.2.1.181:5050</a><br>
Feb 21 14:38:34 csbc02 csbc[30796]: DEBUG: dmq_usrloc
[usrloc_sync.c:423]: usrloc_dmq_execute_action(): Received
DMQ_UPDATE. Update contact info...<br>
Feb 21 14:38:34 csbc02 csbc[30796]: DEBUG: dmq_usrloc
[usrloc_sync.c:75]: add_contact(): aor: 1063362<br>
Feb 21 14:38:34 csbc02 csbc[30796]: DEBUG: dmq_usrloc
[usrloc_sync.c:76]: add_contact(): ci->ruid:
uloc-1-5e502cd3-5629-1<br>
Feb 21 14:38:34 csbc02 csbc[30796]: DEBUG: dmq_usrloc
[usrloc_sync.c:77]: add_contact(): aorhash: 928261667<br>
Feb 21 14:38:34 csbc02 csbc[30796]: DEBUG: dmq_usrloc
[usrloc_sync.c:115]: add_contact(): '1063362' Not found in
usrloc<br>
Feb 21 14:38:34 csbc02 csbc[30796]: DEBUG: dmq_usrloc
[usrloc_sync.c:117]: add_contact(): Insert record<br>
Feb 21 14:38:34 csbc02 csbc[30796]: DEBUG: usrloc
[ul_callback.h:83]: run_ul_callbacks():
contact=0x7fe41ff41f40, callback type 1/15, id 0 entered<br>
Feb 21 14:38:34 csbc02 csbc[30796]: DEBUG: dmq_usrloc
[usrloc_sync.c:800]: dmq_ul_cb_contact(): Callback from
usrloc with type=1<br>
Feb 21 14:38:34 csbc02 csbc[30796]: DEBUG: dmq_usrloc
[usrloc_sync.c:826]: dmq_ul_cb_contact(): Contact received
from DMQ... skip<br>
Feb 21 14:38:34 csbc02 csbc[30796]: ERROR: <core>
[db.c:481]: db_use_table(): invalid parameter value<br>
Feb 21 14:38:34 csbc02 csbc[30796]: ERROR: usrloc
[ucontact.c:669]: db_insert_ucontact(): sql use_table failed<br>
Feb 21 14:38:34 csbc02 csbc[30796]: ERROR: usrloc
[urecord.c:598]: insert_ucontact(): failed to insert in
database<br>
Feb 21 14:38:34 csbc02 csbc[30796]: DEBUG: dmq_usrloc
[usrloc_sync.c:121]: add_contact(): Insert ucontact<br>
Feb 21 14:38:34 csbc02 csbc[30796]: DEBUG: dmq_usrloc
[usrloc_sync.c:124]: add_contact(): Release record<br>
Feb 21 14:38:34 csbc02 csbc[30796]: DEBUG: dmq_usrloc
[usrloc_sync.c:126]: add_contact(): Unlock udomain<br>
Feb 21 14:38:34 csbc02 csbc[30796]: DEBUG: sl [sl.c:305]:
send_reply(): reply in stateless mode (sl)<br>
Feb 21 14:38:34 csbc02 csbc[30796]: DEBUG: <core>
[core/msg_translator.c:161]: check_via_address():
(10.2.1.181, 10.2.1.181, 0)<br>
</div>
</div>
<div><br>
</div>
<div>Can anyone help me understand what's the problem? I have
the server_id setting, and the modparam server_id_filter, so
shouldn't the receiving node just ignore any database tasks?</div>
<div><br>
</div>
<div><br>
</div>
<div>Thanks, </div>
<div>Joel.</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
Kamailio (SER) - Users Mailing List
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<pre cols="72">--
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank">www.asipto.com</a>
<a href="http://www.twitter.com/miconda" target="_blank">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" target="_blank">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - March 9-11, 2020, Berlin - <a href="http://www.asipto.com" target="_blank">www.asipto.com</a>
Kamailio World Conference - April 27-29, 2020, in Berlin -- <a href="http://www.kamailioworld.com" target="_blank">www.kamailioworld.com</a></pre>
</div>
</blockquote></div>