Hi Daniel<br><br><br>this is my test:<br><br>1- Kamailio starts and correctly loads the mtree <br>2- I make whatever modification in the tree and reload with mt_reload<br>Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: db_postgres [km_dbase.c:153]: sending query ok: 0x92f880 - [select tname,tprefix,tvalue from mtree  order by tname]<br>
Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: &lt;core&gt; [db_res.c:118]: allocate 48 bytes for result set at 0x94cd00<br>Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: db_postgres [km_dbase.c:220]: 0x92f880 PQresultStatus(PGRES_TUPLES_OK) PQgetResult(0x29f05f0)<br>
Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: db_postgres [km_res.c:108]: 3 columns returned from the query<br>Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: &lt;core&gt; [db_res.c:155]: allocate 24 bytes for result names at 0x94cc60<br>
[....]<br>Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: db_postgres [km_res.c:267]: freeing row buffer at 0x94c940<br>Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: mtree [mtree.c:738]: adding new tname [1]<br>Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: &lt;core&gt; [db_res.c:54]: freeing 3 rows<br>
[...]<br>Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: &lt;core&gt; [db_res.c:94]: freeing result names at 0x94cc60<br>Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: &lt;core&gt; [db_res.c:99]: freeing result types at 0x94cbc0<br>
Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: &lt;core&gt; [db_res.c:136]: freeing result set at 0x94cd00<br>Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: db_postgres [km_dbase.c:313]: PQclear(0x29f05f0) result set<br>
<br>3. Postgres DB restarts (either through restart, or /stop/wait a minute/start)<br>No log is written in Kamailio when this happens.<br><br>4.- I try again to reload the tree, and these are the logs:<br>Jan 14 04:21:42 kam-test ./kamailio[31205]: DEBUG: db_postgres [km_dbase.c:153]: sending query ok: 0x92f880 - [select tname,tprefix,tvalue from mtree  order by tname]<br>
Jan 14 04:21:42 kam-test ./kamailio[31205]: DEBUG: &lt;core&gt; [db_res.c:118]: allocate 48 bytes for result set at 0x94cd00<br>Jan 14 04:21:42 kam-test ./kamailio[31205]: DEBUG: db_postgres [km_dbase.c:220]: 0x92f880 PQresultStatus(PGRES_FATAL_ERROR) PQgetResult(0x29ef0a0)<br>
Jan 14 04:21:42 kam-test ./kamailio[31205]: ERROR: db_postgres [km_dbase.c:236]: 0x92f880 - invalid query, execution aborted<br>Jan 14 04:21:42 kam-test ./kamailio[31205]: ERROR: db_postgres [km_dbase.c:237]: 0x92f880 - PQresultStatus(PGRES_FATAL_ERROR)<br>
Jan 14 04:21:42 kam-test ./kamailio[31205]: ERROR: db_postgres [km_dbase.c:238]: 0x92f880: server closed the connection unexpectedly#012#011This probably means the server terminated abnormally#012#011before or while processing the request.#012<br>
Jan 14 04:21:42 kam-test ./kamailio[31205]: DEBUG: &lt;core&gt; [db_res.c:81]: freeing 0 columns<br>Jan 14 04:21:42 kam-test ./kamailio[31205]: DEBUG: &lt;core&gt; [db_res.c:136]: freeing result set at 0x94cd00<br>Jan 14 04:21:42 kam-test ./kamailio[31205]: ERROR: mtree [mtree_mod.c:633]: Error while fetching result<br>
Jan 14 04:21:42 kam-test ./kamailio[31205]: ERROR: db_postgres [km_dbase.c:329]: invalid parameter value<br>Jan 14 04:21:42 kam-test ./kamailio[31205]: ERROR: mtree [mtree_mod.c:744]: cannot re-load info from database<br>
<br>Thanks in advance<br><br><br>Regards<br><br>Javi<br><br><div class="gmail_quote">On Thu, Jan 13, 2011 at 1:56 PM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

  
    
  
  <div bgcolor="#ffffff" text="#000000">
    Can you send the log messages (debug=3) for that moment (restart of
    pg server and making a new call/registration)?<br>
    <br>
    Daniel<div><div></div><div class="h5"><br>
    <br>
    On 1/13/11 12:00 PM, Javier Gallart wrote:
    </div></div><blockquote type="cite"><div><div></div><div class="h5">Hi Daniel<br>
      <br>
      I have just tested it and I&#39;m getting the same results. This is
      the kamailio version I&#39;m testing:<br>
      root@kam-test:/usr/local/kamailio/sbin# ./kamailio -V<br>
      version: kamailio 3.2.0-dev2 (x86_64/linux) 35568f<br>
      <br>
      Thanks!<br>
      <br>
      Javi<br>
      <br>
      <br>
      <div class="gmail_quote">On Tue, Jan 4, 2011 at 3:46 PM, Javier
        Gallart <span dir="ltr">&lt;<a href="mailto:jgallartm@gmail.com" target="_blank">jgallartm@gmail.com</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
          Hi list
          <div><br>
          </div>
          <div>we have been testing the mtree module. We do periodical
            reloads of the mtree table with the &quot;mi mt_reload&quot; command
            through xmlrpc. It works fine except when the db is
            restarted. If we manually restart the db and then try the
            mt_reload commands we get this error:</div>
          <div>
            <div>Jan  4 09:13:17
              server /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:
              ERROR: db_postgres [km_dbase.c:152]: 0xa6a490 PQsendQuery
              Error: server closed the connection
              unexpectedly#012#011This probably means the server
              terminated abnormally#012#011before or while processing
              the request.#012 Query: select partition,prefix,route from
              trees  order by partition</div>
            <div>Jan  4 09:13:17 server
              /usr/local/kamailio-3.1.1/sbin/kamailio[28534]: ERROR:
              &lt;core&gt; [db_query.c:101]: error while submitting
              query</div>
            <div>Jan  4 09:13:17 server
              /usr/local/kamailio-3.1.1/sbin/kamailio[28534]: ERROR:
              mtree [mtree_mod.c:622]: Error while querying db</div>
            <div>Jan  4 09:13:17 server
              /usr/local/kamailio-3.1.1/sbin/kamailio[28534]: ERROR:
              mtree [mtree_mod.c:738]: cannot re-load info from database</div>
          </div>
          <div><br>
          </div>
          <div>Is there a way to reconnect to the db before sending that
            command?</div>
          <div><br>
          </div>
          <div>Thanks in advance</div>
          <div><br>
          </div>
          <div>Regards</div>
          <div><br>
          </div>
          <div>Javi</div>
          <div><br>
          </div>
        </blockquote>
      </div>
      <br>
      </div></div><pre><fieldset></fieldset>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote><div class="im">
    <br>
    <pre cols="72">-- 
Daniel-Constantin Mierla
Kamailio (OpenSER) Advanced Training
Jan 24-26, 2011, Irvine, CA, USA
<a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></pre>
  </div></div>

</blockquote></div><br>