<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hello,</p>
    <p>is there any other application that accesses the location table?</p>
    <p>That error message usually appears when the update of the record
      cannot be made because it is locked for long time by something
      else.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <div class="moz-cite-prefix">On 07.01.21 18:23, Duarte Rocha wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAAJJHZjWN6JqM9aer3AD4iF2wyLNhv_tDsDQ=CqMvjNyBPgpOA@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi all, <br>
        <br>
        I've made a post last month regarding losing MySQL connections
         - <a
href="https://lists.kamailio.org/pipermail/sr-users/2020-December/111389.html"
          moz-do-not-send="true">https://lists.kamailio.org/pipermail/sr-users/2020-December/111389.html</a><br>
        <br>
        At the time I thought connections were dying as a consequence of
        low activity and traffic on the proxy. Meanwhile, I've migrated
        a great number of equipments to the proxy with Registers being
        refreshed every 10minutes and the problem still persists.<br>
        <br>
        In order to try to fix this i've added timeout_interval and
        ping_interval from the db_mysql module. My SQL client on the
        Kamailio machine is mysql-community-client  5.6.50-2.el7. It
        writes and reads in a remote InnoDB database.<br>
        <br>
        This are the logs i get from Kamailio when the problem appears :
        <br>
        <br>
        Jan  7 09:43:27 sbc_bbt01_active
        /usr/local/kamailio-5.4/sbin/kamailio[21735]: ERROR: {1 27880
        REGISTER e5f8f7bc-cbb2-40b3-9037-edacd6276a2b} db_mysql
        [km_dbase.c:123]: db_mysql_submit_query(): driver error on
        query: Lock wait timeout exceeded; try restarting transaction
        (1205)<br>
        Jan  7 09:43:27 sbc_bbt01_active
        /usr/local/kamailio-5.4/sbin/kamailio[21735]: ERROR: {1 27880
        REGISTER e5f8f7bc-cbb2-40b3-9037-edacd6276a2b} <core>
        [db_query.c:348]: db_do_update(): error while submitting query<br>
        Jan  7 09:43:27 sbc_bbt01_active
        /usr/local/kamailio-5.4/sbin/kamailio[21735]: ERROR: {1 27880
        REGISTER e5f8f7bc-cbb2-40b3-9037-edacd6276a2b} usrloc
        [ucontact.c:1147]: db_update_ucontact_ruid(): updating database
        failed<br>
        Jan  7 09:43:27 sbc_bbt01_active
        /usr/local/kamailio-5.4/sbin/kamailio[21735]: ERROR: {1 27880
        REGISTER e5f8f7bc-cbb2-40b3-9037-edacd6276a2b} usrloc
        [ucontact.c:1663]: update_contact_db(): failed to update
        database<br>
        Jan  7 09:43:27 sbc_bbt01_active
        /usr/local/kamailio-5.4/sbin/kamailio[21735]: ERROR: {1 27880
        REGISTER e5f8f7bc-cbb2-40b3-9037-edacd6276a2b} registrar
        [save.c:784]: update_contacts(): failed to update contact<br>
        Jan  7 09:43:27 sbc_bbt01_active
        /usr/local/kamailio-5.4/sbin/kamailio[21735]: ERROR: {1 27880
        REGISTER e5f8f7bc-cbb2-40b3-9037-edacd6276a2b} sl
        [sl_funcs.c:414]: sl_reply_error(): stateless error reply used:
        I'm terribly sorry, server error occurred (1/SL)<br>
        <br>
        <br>
        Originally I had usrloc db_mode on mode 3 - DB-Only Scheme. In
        order to try to mitigate the issue I changed it to mode 1 -
        Write-Through scheme but even then I get the same log errors and
        an "500" error is still sent to the client. I chose this mode
        since, as far as I can understand it applies changes directly to
        DB but also uses cache. Please correct me if i'm wrong on that.<br>
        <br>
        Has this issue happened with anyone before? Is there a way to
        mitigate this issue? My only constraint is that I need the
        database to be always updated since I have an HA setup, and as
        such, I can't use cache only methods.<br>
        <br>
        Best Regards,<br>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Funding: <a class="moz-txt-link-freetext" href="https://www.paypal.me/dcmierla">https://www.paypal.me/dcmierla</a></pre>
  </body>
</html>