<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><tt>Since you are using OpenSIPS 2.2, you can tune the following
        modparams of "db_mysql" [1], and see if behavior improves:</tt></p>
    <p><tt>- max_db_queries (how many times a query is attempted)</tt><br>
      <meta http-equiv="content-type" content="text/html;
        charset=windows-1252">
    </p>
    <p><tt>- max_db_retries (for each query attempt above ^, how many
        attempts to connect to the MySQL server)</tt></p>
    <p><tt><br>
        [1]:
        <a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/2.2.x/db_mysql.html#id249634">http://www.opensips.org/html/docs/modules/2.2.x/db_mysql.html#id249634</a><br>
      </tt></p>
    <pre class="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <div class="moz-cite-prefix">On 12.09.2016 13:02, Denis wrote:<br>
    </div>
    <blockquote cite="mid:4210588823.20160912130227@ptl.ru" type="cite">
      <title>Re: [OpenSIPS-Users] Opensips 2.2.1 dr_rules is empty</title>
      <span style=" font-family:'Times New Roman'; font-size: 12pt;">Hello,.
        Liviu!<br>
        <br>
        I saw in log "<span style=" font-family:'courier new';">too many
          reconnects<span style=" font-family:'Times New Roman';">".
            Unfortunately it does not reflected in log files that i
            attached early but it was there.<br>
            So.<br>
            I have two servers with two mysql + Opensips  installation.
            As you probably gassed one server is active and another is
            stand by. <br>
            Active server has "Server version:
            5.5.50-0ubuntu0.12.04.1-log (Ubuntu)" mysql installation and
            standby  server has "Server version:
            5.5.44-0ubuntu0.14.04.1-log (Ubuntu)" mysql installation.<br>
            Respectively active server has "Ubuntu 12.04.5 LTS precise"
            and standby has "Ubuntu 14.04.3 LTS trusty"<br>
            Mysql replication master-master has been customized between
            two servers.<br>
            <br>
          </span></span></span><a moz-do-not-send="true" style="
        font-family:'arial'; font-size: 10pt;"
        href="mailto:denis7979@mail.ru">mailto:denis7979@mail.ru</a><br>
      <br>
      <table bgcolor="#ffffff">
        <tbody>
          <tr>
            <td bgcolor="#0000ff" width="2"><br>
            </td>
            <td><span style=" font-family:'courier new'; font-size:
                12pt;">Hi Denis,<br>
                Looking through the logs, this one seems to be relevant,
                and we need to understand the root cause for why it's
                happening:<br>
                Aug 19 17:00:37 opensips-main
                /usr/local/opensips2.1/sbin/opensips[17749]:
                WARNING:drouting:dr_load_routing_info: table
                "ast_dr_rules" is empty<br>
                <br>
                As far as I can understand, one "dr_reload" command
                finds the table empty, then the next one properly
                retrieves the data! Although I see several disconnect
                events in there (for each process!), the driver should
                have reported "too many reconnects" errors if those were
                really the cause.<br>
                <br>
                Could you provide more info about your MySQL setup? Is
                it a server, slave or cluster? What software and what
                version?<br>
                Liviu Chircu<br>
                OpenSIPS Developer<br>
              </span><a moz-do-not-send="true" style="
                font-family:'courier new'; font-size: 12pt;"
                href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a><br>
              <span style=" font-family:'times new roman'; font-size:
                12pt;">On 09.09.2016 09:19, Denis wrote:<br>
              </span>
              <table>
                <tbody>
                  <tr>
                    <td bgcolor="#3200ff" width="2"><br>
                    </td>
                    <td><span style=" font-family:'times new roman';
                        font-size: 12pt;">Re: [OpenSIPS-Users] Opensips
                        2.2.1 dr_rules is empty Hello!<br>
                        <br>
                        Any ideas about the problem?<br>
                        <br>
                      </span><a moz-do-not-send="true" style="
                        font-family:'arial'; font-size: 10pt;"
                        href="mailto:denis7979@mail.ru">mailto:denis7979@mail.ru</a><br>
                      <br>
                      <table>
                        <tbody>
                          <tr>
                            <td bgcolor="#0000ff" width="2"><br>
                            </td>
                            <td>
                              <table>
                                <tbody>
                                  <tr>
                                    <td bgcolor="#0000ff" width="2"><br>
                                    </td>
                                    <td><span style=" font-family:'times
                                        new roman'; font-size: 12pt;">Hello,
                                        Bogdan<br>
                                        <br>
                                        I am sorry that i did not
                                        describe the problem more
                                        clearly.<br>
                                        404 opensips sends because in
                                        opensips.cfg i wrote a logic
                                        that if in dr_rules opensips
                                        finds no rules for routing it
                                        must send 404.<br>
                                        And the problem i think is
                                        there. Opensips began rejects
                                        all calls with 404, i.e. it
                                        could not find any rules in
                                        dr_rules table.<br>
                                        Everthing began fine after fifo
                                        dr_reload command execution,
                                        i.e. after dr_rules updating.  
                                        <br>
                                        <br>
                                        <span style="
                                          font-family:'arial';
                                          font-size: 10pt;"><i>-- <br>
                                          </i></span></span><a
                                        moz-do-not-send="true" style="
                                        font-family:'arial'; font-size:
                                        10pt;"
                                        href="mailto:d.putyato@ptl.ru">mailto:denis7979@mail.ru</a><br>
                                      <br>
                                      <table bgcolor="#ffffff">
                                        <tbody>
                                          <tr>
                                            <td bgcolor="#0000ff"
                                              width="2"><br>
                                            </td>
                                            <td><span style="
                                                font-family:'courier
                                                new'; font-size: 12pt;">Hi,<br>
                                                <br>
                                                OpenSIPS by itself does
                                                not send any 404. If it
                                                does, it does it because
                                                you put that into the
                                                script. So, you have to
                                                look into your script
                                                and see the logical path
                                                that makes OpenSIPS to
                                                get to sending a 404
                                                reply.<br>
                                                <br>
                                                You may use the
                                                script_trace :<br>
                                              </span><a
                                                moz-do-not-send="true"
                                                style="
                                                font-family:'courier
                                                new'; font-size: 12pt;"
href="http://www.opensips.org/Documentation/Script-CoreFunctions-2-2#toc43">http://www.opensips.org/Documentation/Script-CoreFunctions-2-2#toc43</a><br>
                                              <br>
                                              <span style="
                                                font-family:'courier
                                                new'; font-size: 12pt;">Regards,<br>
                                                Bogdan-Andrei Iancu<br>
                                                OpenSIPS Founder and
                                                Developer<br>
                                              </span><a
                                                moz-do-not-send="true"
                                                style="
                                                font-family:'courier
                                                new'; font-size: 12pt;"
href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a><br>
                                              <span style="
                                                font-family:'times new
                                                roman'; font-size:
                                                12pt;">On 30.08.2016
                                                22:26, Denis wrote:<br>
                                              </span>
                                              <table>
                                                <tbody>
                                                  <tr>
                                                    <td
                                                      bgcolor="#3200ff"
                                                      width="2"><br>
                                                    </td>
                                                    <td><span style="
                                                        font-family:'times
                                                        new roman';
                                                        font-size:
                                                        12pt;">Re:
                                                        Opensips 2.2.1
                                                        dr_rules is
                                                        empty Hello!<br>
                                                        <br>
                                                        Some time ago i
                                                        wrote about a
                                                        problem when
                                                        Opensips began
                                                        reject all calls
                                                        with 404 code.<br>
                                                        Unfortunately i
                                                        did not received
                                                        any answer.<br>
                                                        Since that time
                                                        i have made
                                                        upgrade from
                                                        2.1.2 to 2.2.1
                                                        and today i have
                                                        got the same
                                                        problem.
                                                        Opensips began
                                                        rejects all
                                                        calls with 404
                                                        code. <br>
                                                        <br>
                                                        Based on the
                                                        information from
                                                        log, i make
                                                        suggest that
                                                        problem began
                                                        when dr_reload
                                                        command has been
                                                        received. <br>
                                                        And the problem
                                                        has been solved,
                                                        again, when the
                                                        dr_reload
                                                        command has been
                                                        received (the
                                                        period about two
                                                        commands is
                                                        about a couple
                                                        of minutes).<br>
                                                        <br>
                                                        I please help to
                                                        solve the
                                                        problem. <br>
                                                        <br>
                                                        Thank you.<br>
                                                        <br>
                                                      </span><a
                                                        moz-do-not-send="true"
                                                        style="
                                                        font-family:'arial';
                                                        font-size:
                                                        10pt;"
                                                        href="mailto:denis7979@mail.ru">mailto:denis7979@mail.ru</a><br>
                                                      <br>
                                                      <table>
                                                        <tbody>
                                                          <tr>
                                                          <td
                                                          bgcolor="#0000ff"
                                                          width="2"><br>
                                                          </td>
                                                          <td><span
                                                          style="
                                                          font-family:'times
                                                          new roman';
                                                          font-size:
                                                          12pt;">Hello!<br>
                                                          <br>
                                                          Recently i
                                                          begun to get
                                                          such problem.<br>
                                                          Opensips
                                                          rejects all
                                                          calls with 404
                                                          code. I can
                                                          solve the
                                                          problem by
                                                          making
                                                          dr_reload.<br>
                                                          I tried to
                                                          analyze a log
                                                          and what i
                                                          could found
                                                          you can see in
                                                          attachment.<br>
                                                          As i could
                                                          understand
                                                          last problem
                                                          began after
                                                          dr_reload.<br>
                                                          <br>
                                                          Thank you for
                                                          any help.<br>
                                                          <br>
                                                          <br>
                                                          </span><a
                                                          moz-do-not-send="true"
                                                          style="
                                                          font-family:'arial';
                                                          font-size:
                                                          10pt;"
                                                          href="mailto:denis7979@mail.ru">mailto:denis7979@mail.ru</a></td>
                                                          </tr>
                                                        </tbody>
                                                      </table>
                                                      <br>
                                                      <br>
                                                      <br>
                                                      <br>
                                                      <br>
                                                      <br>
                                                      <span style="
                                                        font-family:'courier
                                                        new'; font-size:
                                                        12pt;">_______________________________________________<br>
                                                        Users mailing
                                                        list<br>
                                                      </span><a
                                                        moz-do-not-send="true"
                                                        style="
                                                        font-family:'courier
                                                        new'; font-size:
                                                        12pt;"
                                                        href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
                                                      <a
                                                        moz-do-not-send="true"
                                                        style="
                                                        font-family:'courier
                                                        new'; font-size:
                                                        12pt;"
                                                        href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></td>
                                                  </tr>
                                                </tbody>
                                              </table>
                                            </td>
                                          </tr>
                                        </tbody>
                                      </table>
                                    </td>
                                  </tr>
                                </tbody>
                              </table>
                            </td>
                          </tr>
                        </tbody>
                      </table>
                      <br>
                      <br>
                      <br>
                      <span style=" font-family:'courier new';
                        font-size: 12pt;">_______________________________________________<br>
                        Users mailing list<br>
                      </span><a moz-do-not-send="true" style="
                        font-family:'courier new'; font-size: 12pt;"
                        href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
                      <span style=" font-family:'courier new';
                        font-size: 12pt;">
                      </span><a moz-do-not-send="true" style="
                        font-family:'courier new'; font-size: 12pt;"
                        href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
                      <span style=" font-family:'courier new';
                        font-size: 12pt;">
                      </span></td>
                  </tr>
                </tbody>
              </table>
            </td>
          </tr>
        </tbody>
      </table>
    </blockquote>
    <br>
  </body>
</html>