<div dir="ltr"><div dir="auto">Hi Alex,</div><div dir="auto"><br></div><div>Can you provide your usrloc and dmq_usrloc module parameters please?</div><div><br></div><div dir="auto">Cheers,</div><div dir="auto"><br></div><div dir="auto">Charles</div><div dir="auto"><br></div><br><div class="gmail_quote"><div>On Fri, 15 Dec 2017 at 20:54, Alex Balashov <<a href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">By way of follow-up:<br>
<br>
db_mode 1 likewise fails, in the same fashion.<br>
<br>
db_mode 2 does work and successfully sync the contact to the DB on<br>
timer_interval.<br>
<br>
So, I suspect this is some sort of race that raises when immediate<br>
database write-through is required.<br>
<br>
On Fri, Dec 15, 2017 at 02:31:06PM -0500, Alex Balashov wrote:<br>
<br>
> Hi,<br>
><br>
> Running bleeding-edge branch 5.1 clone here.<br>
><br>
> dmq_usrloc replication works fine when using in-memory only backing for<br>
> the underlying usrloc module, i.e. db_mode 0. I haven't tried mode 1 and<br>
> mode 2.<br>
><br>
> I use mode 3, so that contacts are immediately persisted straight to a<br>
> local database. The database flavour is PostgreSQL in this case.<br>
><br>
> When new contacts replicated via dmq_usrloc come in, I get this in the<br>
> Kamailio log:<br>
><br>
> Dec 15 19:23:35 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]<wbr>: ERROR: <core> [db.c:465]: db_use_table(): invalid parameter value<br>
> Dec 15 19:23:35 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]<wbr>: ERROR: usrloc [udomain.c:817]: db_load_urecord_by_ruid(): failed to use table location<br>
> Dec 15 19:23:35 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]<wbr>: WARNING: dmq_usrloc [usrloc_sync.c:147]: delete_contact(): AOR/Contact not found<br>
> Dec 15 19:23:35 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]<wbr>: ERROR: <core> [db.c:465]: db_use_table(): invalid parameter value<br>
> Dec 15 19:23:35 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]<wbr>: ERROR: usrloc [udomain.c:817]: db_load_urecord_by_ruid(): failed to use table location<br>
> Dec 15 19:23:35 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]<wbr>: WARNING: dmq_usrloc [usrloc_sync.c:147]: delete_contact(): AOR/Contact not found<br>
><br>
> I added some code to lib/srdb1/db.c to print the parameter name and the<br>
> location being passed to db_use_table():<br>
><br>
>   */<br>
>  int db_use_table(db1_con_t* _h, const str* _t)<br>
>  {<br>
> +       LM_ERR("DB handle = %p\n", _h);<br>
> +<br>
>         if (!_h || !_t || !_t->s) {<br>
> -               LM_ERR("invalid parameter value\n");<br>
> +               LM_ERR("invalid parameter value %.*s\n", _t->len, _t->s);<br>
>                 return -1;<br>
>         }<br>
><br>
> And got this:<br>
><br>
> Dec 15 19:23:36 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]<wbr>: ERROR: <core> [db.c:462]: db_use_table(): DB handle = (nil)<br>
> Dec 15 19:23:36 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]<wbr>: ERROR: <core> [db.c:465]: db_use_table(): invalid parameter value location<br>
> Dec 15 19:23:36 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]<wbr>: ERROR: usrloc [udomain.c:631]: db_load_urecord(): failed to use table location<br>
> Dec 15 19:23:36 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]<wbr>: ERROR: <core> [db.c:462]: db_use_table(): DB handle = (nil)<br>
> Dec 15 19:23:36 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]<wbr>: ERROR: <core> [db.c:465]: db_use_table(): invalid parameter value location<br>
> Dec 15 19:23:36 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]<wbr>: ERROR: usrloc [ucontact.c:679]: db_insert_ucontact(): sql use_table failed<br>
> Dec 15 19:23:36 evaristesys-testbed-2 /usr/local/sbin/kamailio[9395]<wbr>: ERROR: usrloc [urecord.c:582]: insert_ucontact(): failed to insert in database<br>
><br>
> So, it appears the DB handle being passed here is NULL is in this<br>
> situation.<br>
><br>
> The same AOR is present in 'ul.dump' RPC command when using db_mode 0.<br>
><br>
> Please advise? :)<br>
><br>
> -- Alex<br>
><br>
> --<br>
> Alex Balashov | Principal | Evariste Systems LLC<br>
><br>
> Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)<br>
> Web: <a href="http://www.evaristesys.com/" rel="noreferrer" target="_blank">http://www.evaristesys.com/</a>, <a href="http://www.csrpswitch.com/" rel="noreferrer" target="_blank">http://www.csrpswitch.com/</a><br>
><br>
> ______________________________<wbr>_________________<br>
> Kamailio (SER) - Users Mailing List<br>
> <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
> <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
<br>
--<br>
Alex Balashov | Principal | Evariste Systems LLC<br>
<br>
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)<br>
Web: <a href="http://www.evaristesys.com/" rel="noreferrer" target="_blank">http://www.evaristesys.com/</a>, <a href="http://www.csrpswitch.com/" rel="noreferrer" target="_blank">http://www.csrpswitch.com/</a><br>
<br>
______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
</blockquote></div></div>

<br>
<div><font color="gray" style="font-size:10pt;font-family:Helvetica,Arial,sans-serif">Sipcentric Ltd.
                Company registered in England & Wales no. 7365592.</font><span style="font-size:10pt;font-family:Helvetica,Arial,sans-serif"> </span><font color="gray" style="font-size:10pt;font-family:Helvetica,Arial,sans-serif">Registered
                office: Faraday Wharf, Innovation Birmingham Campus, Holt Street, Birmingham Science Park, Birmingham B7 4BB.</font></div>