<div dir="ltr">Hi Andres,<div><br></div><div>I agree that this could potentially lead to a temporary inconsistency between the database and the cache. </div><div><br></div><div>However if you<span style="font-size:12.8000001907349px"> look at how a domain is created through the webinterface (</span><a href="https://github.com/sipwise/ngcp-panel/blob/master/lib/NGCP/Panel/Controller/Domain.pm#L99-L147" style="font-size:12.8000001907349px" target="_blank">https://github.com/sipwise/ngcp-panel/blob/master/lib/NGCP/Panel/Controller/Domain.pm#L99-L147</a><span style="font-size:12.8000001907349px">) you will see that this also can lead to inconsistencies between the cache and database. A failure of the XML-RPC call on line 147 won't rollback the transaction. So behaviour between the API and web interface seems to be different.</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div>Maybe both the frontend and api code should be changed to follow the following steps:</div><div><br></div><div>1. Create record in database and commit to database</div><div>2. Run XML-RPC request in a try-catch</div><div>3. If step 2 fails rollback what was committed in step 1</div><div><br></div><div>Dennis</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><font size="2" face="arial, helvetica, sans-serif">Best from Amsterdam,</font></div><div><font size="2" face="arial, helvetica, sans-serif"><br></font></div><div><font size="2" face="arial, helvetica, sans-serif">Dennis van der Vliet | Senior Engineer</font></div><div><font size="2" face="arial, helvetica, sans-serif"><br></font></div><div><font size="2" face="arial, helvetica, sans-serif">M: +31 6 53 47 44 96</font></div><div><font size="2" face="arial, helvetica, sans-serif">E: <a href="mailto:dennis@messagebird.com" target="_blank">dennis@messagebird.com</a></font></div><div><div style="font-size:12.8000001907349px"><font size="2" face="arial, helvetica, sans-serif">MessageBird</font></div></div><div><font size="2" face="arial, helvetica, sans-serif"><a href="https://nl.linkedin.com/in/dennisvandervliet" target="_blank">LinkedIn</a> | <a href="https://twitter.com/dennisvdvliet" target="_blank">Twitter</a></font></div><div><br></div><div><div style="margin:0px"><br></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On 20 April 2015 at 10:45, Andreas Granig <span dir="ltr"><<a href="mailto:agranig@sipwise.com" target="_blank">agranig@sipwise.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
>From my point of view, the pull request will create data inconsistencies<br>
if the API fails to reload kamailio-proxy cache and prosody cache. It<br>
won't throw an error anymore if the cache reload fails, causing the<br>
domain to be existent in the DB but nonexistent in the cache, leading to<br>
"domain not served here" errors again, until you manually restart<br>
kamailio-proxy and prosody. That's why we put the cache reload into the<br>
same transaction.<br>
<br>
There might probably be an issue here, but this patch is not going to<br>
solve it correctly. It'd be interesting to see the api.log when creating<br>
a domain. If the API call fails, please send the content of the log. If<br>
the API call is ok but you still get a "domain not served here", then<br>
it'd be interesting to check the output of<br>
<br>
ngcp-sercmd proxy domain.dump<br>
<br>
for the kamailio part and<br>
<br>
telnet localhost 5582<br>
host:list()<br>
<br>
for the prosody part.<br>
<br>
It has been reported from time to time that the ip and/or port part of<br>
prosody is wrong in<br>
<br>
mysql provisioning -e 'select * from xmlhosts'<br>
<br>
when playing with ip addresses on the server, which causes cache<br>
reloading to fail, since it uses the "Prosody" and "Kamailio-SR" entries<br>
to contact the services in question to reload the caches.<br>
<br>
Andreas<br>
<span class=""><br>
<br>
<br>
On 04/15/2015 05:36 PM, Dennis van der Vliet wrote:<br>
> The issue was not with the subscriber but with the domain. I created a<br>
> pull request (<a href="https://github.com/sipwise/ngcp-panel/pull/1" target="_blank">https://github.com/sipwise/ngcp-panel/pull/1</a>) that fixes it.<br>
><br>
> Seems to be related to the kamailio-proxy not being flushed after<br>
> creating a new domain.<br>
><br>
> Dennis<br>
><br>
> Best from Amsterdam,<br>
><br>
> Dennis van der Vliet | Senior Engineer<br>
><br>
> M: <a href="tel:%2B31%206%2053%2047%2044%2096" value="+31653474496">+31 6 53 47 44 96</a><br>
</span>> E: <a href="mailto:dennis@messagebird.com">dennis@messagebird.com</a> <mailto:<a href="mailto:dennis@messagebird.com">dennis@messagebird.com</a>><br>
> MessageBird<br>
> LinkedIn <<a href="https://nl.linkedin.com/in/dennisvandervliet" target="_blank">https://nl.linkedin.com/in/dennisvandervliet</a>> | Twitter<br>
> <<a href="https://twitter.com/dennisvdvliet" target="_blank">https://twitter.com/dennisvdvliet</a>><br>
<span class="">><br>
><br>
><br>
> On 15 April 2015 at 17:18, Serge Yuriev <<a href="mailto:me@nevian.org">me@nevian.org</a><br>
</span><span class="">> <mailto:<a href="mailto:me@nevian.org">me@nevian.org</a>>> wrote:<br>
><br>
>     Hello,<br>
><br>
>     I also see such error but in my case user created via panel.<br>
>     Mr3.8.1<br>
><br>
>     --<br>
>     Serge via mobile<br>
><br>
>     Il giorno 15 апр. 2015 г., alle ore 17:12, Andrew Pogrebennyk<br>
</span>>     <<a href="mailto:apogrebennyk@sipwise.com">apogrebennyk@sipwise.com</a> <mailto:<a href="mailto:apogrebennyk@sipwise.com">apogrebennyk@sipwise.com</a>>> ha scritto:<br>
<span class="">><br>
>>     Hi,<br>
>>     there is no such trigger on subscriber creation via API. Could you<br>
>>     please provide an example of such request (you may check<br>
>>     /var/log/ngcp/api.log).<br>
>>     What about the domains, are you using the same domain for the API<br>
>>     request and on the panel? This error message means that request<br>
>>     domain doesn't exist in the system.<br>
>><br>
>>     Hope this helps,<br>
>>     Andrew<br>
>><br>
>>     On 04/13/2015 05:53 PM, Dennis van der Vliet wrote:<br>
>>><br>
>>>     Hi,<br>
>>><br>
>>>     When trying to create a subscriber through the API we encounter<br>
>>>     the following issue. After creating the user and entering the<br>
>>>     credentials on a phone, registration is not possible.<br>
>>><br>
>>>     Further inspection of the log files (kamailio-proxy.log) gives us<br>
>>>     the following info:<br>
>>><br>
</span>>>>     |Apr 13 15:43:54 voip02-ams3-do proxy[4389]: NOTICE: <script>: New request on proxy - M=REGISTER R=sip:<a href="http://sub.domain.co" target="_blank">sub.domain.co</a> <<a href="http://sub.domain.co" target="_blank">http://sub.domain.co</a>> F=<a href="mailto:sip%3Ausername_3217@sub.domain.co">sip:username_3217@sub.domain.co</a> <mailto:<a href="mailto:sip%253Ausername_3217@sub.domain.co">sip%3Ausername_3217@sub.domain.co</a>> T=<a href="mailto:sip%3Ausername_3217@sub.domain.co">sip:username_3217@sub.domain.co</a> <mailto:<a href="mailto:sip%253Ausername_3217@sub.domain.co">sip%3Ausername_3217@sub.domain.co</a>> IP={IP_ADDRESS} (<a href="http://127.0.0.1:5060" target="_blank">127.0.0.1:5060</a> <<a href="http://127.0.0.1:5060" target="_blank">http://127.0.0.1:5060</a>>) ID=b75aa40b-c9aa67f3@{IP_ADDRESS}<br>
>>>     Apr 13 15:43:54 voip02-ams3-do proxy[4389]: WARNING: <script>: Domain not served here - R=sip:<a href="http://sub.domain.co" target="_blank">sub.domain.co</a> <<a href="http://sub.domain.co" target="_blank">http://sub.domain.co</a>> ID=b75aa40b-c9aa67f3@{IP_ADDRESS}<br>
<span class="">>>>     |<br>
>>><br>
>>>     The issue is fixed once we restart kamailio-proxy manually.<br>
>>><br>
>>>     Is some kind of “flush” triggered after creating a subscriber<br>
>>>     through the webinterface that is not triggered when you do the<br>
>>>     same through the API?<br>
>>><br>
>>>     Best from Amsterdam,<br>
>>><br>
>>>     Dennis van der Vliet | Senior Engineer<br>
>>><br>
>>>     M: <a href="tel:%2B31%206%2053%2047%2044%2096" value="+31653474496">+31 6 53 47 44 96</a><br>
</span>>>>     E: <a href="mailto:dennis@messagebird.com">dennis@messagebird.com</a> <mailto:<a href="mailto:dennis@messagebird.com">dennis@messagebird.com</a>><br>
<span class="">>>>     MessageBird<br>
>>><br>
>>>     LinkedIn | Twitter<br>
>>><br>
>>><br>
>><br>
>>     _______________________________________________<br>
>>     Spce-user mailing list<br>
</span>>>     <a href="mailto:Spce-user@lists.sipwise.com">Spce-user@lists.sipwise.com</a> <mailto:<a href="mailto:Spce-user@lists.sipwise.com">Spce-user@lists.sipwise.com</a>><br>
<span class="">>>     <a href="https://lists.sipwise.com/listinfo/spce-user" target="_blank">https://lists.sipwise.com/listinfo/spce-user</a><br>
><br>
>     _______________________________________________<br>
>     Spce-user mailing list<br>
</span>>     <a href="mailto:Spce-user@lists.sipwise.com">Spce-user@lists.sipwise.com</a> <mailto:<a href="mailto:Spce-user@lists.sipwise.com">Spce-user@lists.sipwise.com</a>><br>
<div class="HOEnZb"><div class="h5">>     <a href="https://lists.sipwise.com/listinfo/spce-user" target="_blank">https://lists.sipwise.com/listinfo/spce-user</a><br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Spce-user mailing list<br>
> <a href="mailto:Spce-user@lists.sipwise.com">Spce-user@lists.sipwise.com</a><br>
> <a href="https://lists.sipwise.com/listinfo/spce-user" target="_blank">https://lists.sipwise.com/listinfo/spce-user</a><br>
><br>
_______________________________________________<br>
Spce-user mailing list<br>
<a href="mailto:Spce-user@lists.sipwise.com">Spce-user@lists.sipwise.com</a><br>
<a href="https://lists.sipwise.com/listinfo/spce-user" target="_blank">https://lists.sipwise.com/listinfo/spce-user</a><br>
</div></div></blockquote></div><br></div>