<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hello,<br>
    <br>
    seems to be an issue with sharing db connection, which should not
    happen, but it was reported by others. I will look at it, seems that
    the trouble is in drouting or permissions, as both were always
    involved.<br>
    <br>
    Thanks for reporting,<br>
    Daniel<br>
    <br>
    <br>
    On 11/27/10 12:33 PM, Giorgio Maria Santini wrote:
    <blockquote
      cite="mid:DDF9A409-68D9-4FFC-B5D5-7887BDA4BA86@gmail.com"
      type="cite">
      <div>Hello everybody,</div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>We need to deploy kamailio with both drouting and permissions
        modules enabled. We are using kamailio 3.1.0 and we found,
        probably, a bug in one of the two modules (we don't know where)
        that cause kamailio to quit for an invalid table_version founded
        for table Permissions.&nbsp;</div>
      <div><br>
      </div>
      <div>First, I want to say that in table version there is the right
        record:</div>
      <div><br>
      </div>
      <div>
        <div>kamailio=# select * from version where
          table_name='trusted';</div>
        <div>LOG: &nbsp;statement: select * from version where
          table_name='trusted';</div>
        <div>&nbsp;table_name | table_version&nbsp;</div>
        <div>------------+---------------</div>
        <div>&nbsp;trusted &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 5</div>
        <div>(1 row)</div>
      </div>
      <div><br>
      </div>
      <div>Then, debugging I've found that kamailio do the right query,
        but returns a wrong recordset. Here a little snapshot of the
        debug:</div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;1(2615) DEBUG:
          &lt;core&gt; [db.c:294]: connection 0x82bc910 found in pool</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;1(2615) DEBUG:
          db_postgres [km_dbase.c:149]: 0x82bc8f8 PQsendQuery(select
          gwid,address,strip,pri_prefix,type,attrs from dr_gateways )</div>
      </div>
      <div><br>
      </div>
      <div>...</div>
      <div>....</div>
      <div><br>
      </div>
      <div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_dbase.c:149]: 0x82a74e8 PQsendQuery(select
          table_version from version where table_name='trusted')</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_res.c:116]: allocate 28 bytes for result set
          at 0x82a7598</div>
        <div style="margin: 0px; font: 12px Helvetica;">LOG:&nbsp;&nbsp;statement:
          select gwid,address,strip,pri_prefix,type,attrs from
          dr_gateways&nbsp;</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_dbase.c:403]: 0x82a74e8
          PQresultStatus(PGRES_TUPLES_OK) PQgetResult(0x870c010)</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:108]: 6 columns returned from the query</div>
      </div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>instead of saying "1 columns returned from the query" it
        returns the number of columns of the query launched in the other
        thread, I think. In this case&nbsp;</div>
      <div><br>
      </div>
      <div>"<span class="Apple-style-span" style="font-size: 12px;">select
          gwid,address,strip,pri_prefix,type,attrs from dr_gateway"</span></div>
      <div><span class="Apple-style-span" style="font-size: 12px;"><br>
        </span></div>
      <div><span class="Apple-style-span" style="font-size: 12px;">but
          it's not always the same query, sometimes returns the query of
          the usrloc, or other else.&nbsp;</span></div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>The strange is that it's happen only when Permissions and
        Drouting modules are enabled together. If I remove one of this,
        not depending on which one I choose, everything works ok. We
        absolutely need both modules working together, but this errors
        (a bug??) destroys our dreams of success :)</div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>Here is the complete log:</div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;0(2614) DEBUG:
          db_postgres [km_pg_con.c:72]: opening connection: <a
            moz-do-not-send="true"
            href="postgres://xxxx:xxxx@192.168.190.150:5432/kamailio">postgres://xxxx:xxxx@192.168.190.150:5432/kamailio</a></div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;0(2614) DEBUG:
          db_postgres [km_pg_con.c:80]: PQsetdbLogin(0x8702520)</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;0(2614) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (-127):
          permissions</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;0(2614) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (-127):
          ldap</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;0(2614) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (-127):
          alias_db</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;0(2614) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (-127):
          domain</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;0(2614) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (-127):
          presence</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;0(2614) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (-127):
          presence_xml</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;0(2614) DEBUG:
          presence_xml [presence_xml.c:300]: [-127]&nbsp; pid [2614]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;0(2614) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (-127):
          nathelper</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;0(2614) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (-127):
          mediaproxy</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;1(2615) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (1):
          mi_fifo</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;1(2615) DEBUG:
          &lt;core&gt; [sr_module.c:791]: DEBUG: init_mod_child (1): tm</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;1(2615) DEBUG:
          tm [callid.c:131]: DEBUG: callid:
          '<a class="moz-txt-link-abbreviated" href="mailto:5c94ff7d-2615@192.168.190.185">5c94ff7d-2615@192.168.190.185</a>'</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;1(2615) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (1):
          avpops</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;1(2615) DEBUG:
          &lt;core&gt; [db.c:294]: connection 0x82a7358 found in pool</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;1(2615) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (1):
          usrloc</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;1(2615) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (1):
          registrar</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;1(2615) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (1):
          uri_db</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;1(2615) DEBUG:
          &lt;core&gt; [db.c:294]: connection 0x82a7408 found in pool</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;1(2615) DEBUG:
          &lt;core&gt; [sr_module.c:791]: DEBUG: init_mod_child (1): ctl</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;1(2615) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (1): acc</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;1(2615) DEBUG:
          &lt;core&gt; [db.c:294]: connection 0x82bc668 found in pool</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;1(2615) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (1):
          drouting</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;1(2615) DEBUG:
          &lt;core&gt; [db.c:294]: connection 0x82bc910 found in pool</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;1(2615) DEBUG:
          db_postgres [km_dbase.c:149]: 0x82bc8f8 PQsendQuery(select
          gwid,address,strip,pri_prefix,type,attrs from dr_gateways )</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;1(2615) DEBUG:
          &lt;core&gt; [db_res.c:116]: allocate 28 bytes for result set
          at 0x82a74e8</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (2):
          mi_fifo</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [sr_module.c:791]: DEBUG: init_mod_child (2): tm</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          tm [callid.c:131]: DEBUG: callid:
          '<a class="moz-txt-link-abbreviated" href="mailto:5c94ff7d-2616@192.168.190.185">5c94ff7d-2616@192.168.190.185</a>'</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (2):
          avpops</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db.c:294]: connection 0x82a7358 found in pool</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (2):
          usrloc</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (2):
          registrar</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (2):
          uri_db</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db.c:294]: connection 0x82a7408 found in pool</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [sr_module.c:791]: DEBUG: init_mod_child (2): ctl</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (2): acc</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db.c:294]: connection 0x82bc668 found in pool</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (2):
          drouting</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db.c:294]: connection 0x82bc910 found in pool</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [sr_module.c:807]: DEBUG: init_mod_child (2):
          permissions</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db.c:294]: connection 0x82a7500 found in pool</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_val.c:158]: PQescapeStringConn: in: 7 chars,
          out: 7 chars</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_dbase.c:149]: 0x82a74e8 PQsendQuery(select
          table_version from version where table_name='trusted')</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_res.c:116]: allocate 28 bytes for result set
          at 0x82a7598</div>
        <div style="margin: 0px; font: 12px Helvetica;">LOG:&nbsp; statement:
          select gwid,address,strip,pri_prefix,type,attrs from
          dr_gateways&nbsp;</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_dbase.c:403]: 0x82a74e8
          PQresultStatus(PGRES_TUPLES_OK) PQgetResult(0x870c010)</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:108]: 6 columns returned from the query</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_res.c:153]: allocate 24 bytes for result
          names at 0x82a75c0</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_res.c:163]: allocate 24 bytes for result
          types at 0x82a75e0</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:126]: allocate 8 bytes for RES_NAMES[0]
          at 0x82a7600</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:133]: RES_NAMES(0x82a7600)[0]=[gwid]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:140]: use DB1_INT result type</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:126]: allocate 8 bytes for RES_NAMES[1]
          at 0x82a7610</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:133]: RES_NAMES(0x82a7610)[1]=[address]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:166]: use DB1_STRING result type</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:126]: allocate 8 bytes for RES_NAMES[2]
          at 0x82a7620</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:133]: RES_NAMES(0x82a7620)[2]=[strip]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:140]: use DB1_INT result type</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:126]: allocate 8 bytes for RES_NAMES[3]
          at 0x82a7630</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:133]:
          RES_NAMES(0x82a7630)[3]=[pri_prefix]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:166]: use DB1_STRING result type</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:126]: allocate 8 bytes for RES_NAMES[4]
          at 0x82a7640</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:133]: RES_NAMES(0x82a7640)[4]=[type]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:140]: use DB1_INT result type</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:126]: allocate 8 bytes for RES_NAMES[5]
          at 0x82a7650</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:133]: RES_NAMES(0x82a7650)[5]=[attrs]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:166]: use DB1_STRING result type</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:222]: allocate for 6 columns 24 bytes in
          row buffer at 0x82a7660</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_res.c:182]: allocate 8 bytes for rows at
          0x82a7680</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:242]: PQgetvalue(0x82a74e8,0,0)=[1]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:251]: [0][0] Column[gwid]=[1]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:242]:
          PQgetvalue(0x82a74e8,0,1)=[192.168.190.150]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:251]: [0][1]
          Column[address]=[192.168.190.150]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:242]: PQgetvalue(0x82a74e8,0,2)=[2]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:251]: [0][2] Column[strip]=[2]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:242]: PQgetvalue(0x82a74e8,0,3)=[88]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:251]: [0][3] Column[pri_prefix]=[88]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:242]: PQgetvalue(0x82a74e8,0,4)=[0]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:251]: [0][4] Column[type]=[0]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_res.c:242]: PQgetvalue(0x82a74e8,0,5)=[]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_row.c:119]: allocate 120 bytes for row values
          at 0x82c17f8</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_val.c:73]: converting INT [1]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_val.c:117]: converting STRING
          [192.168.190.150]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_val.c:127]: allocate 16 bytes memory for
          STRING at 0x82a7690 2(2616) DEBUG: &lt;core&gt; [db_val.c:73]:
          converting INT [2]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_val.c:117]: converting STRING [88]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_val.c:127]: allocate 3 bytes memory for
          STRING at 0x82c1878 2(2616) DEBUG: &lt;core&gt; [db_val.c:73]:
          converting INT [0]</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_val.c:56]: converting NULL value 2(2616)
          DEBUG: db_postgres [km_res.c:266]: freeing row buffer at
          0x82a7660</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          db_postgres [km_dbase.c:302]: PQclear(0x870c010) result set</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_res.c:79]: freeing 6 columns</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_res.c:83]: freeing RES_NAMES[0] at 0x82a7600</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_res.c:83]: freeing RES_NAMES[1] at 0x82a7610</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_res.c:83]: freeing RES_NAMES[2] at 0x82a7620</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_res.c:83]: freeing RES_NAMES[3] at 0x82a7630</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_res.c:83]: freeing RES_NAMES[4] at 0x82a7640</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_res.c:83]: freeing RES_NAMES[5] at 0x82a7650</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_res.c:92]: freeing result names at 0x82a75c0</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_res.c:97]: freeing result types at 0x82a75e0</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_res.c:52]: freeing 1 rows</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_row.c:68]: free VAL_STRING[1]
          '192.168.190.150' at 0x82a7690</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_row.c:68]: free VAL_STRING[3] '88' at
          0x82c1878</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_row.c:97]: freeing row values at 0x82c17f8</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_res.c:60]: freeing rows at 0x82a7680</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_res.c:134]: freeing result set at 0x82a7598</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) ERROR:
          &lt;core&gt; [db.c:408]: invalid version 1 for table trusted
          found, expected 5 (check table structure and table "version")</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) ERROR:
          permissions [trusted.c:249]: error during table version check.</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) DEBUG:
          &lt;core&gt; [db_pool.c:97]: connection still kept in the pool</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) ERROR:
          &lt;core&gt; [sr_module.c:811]: init_mod_child(): Error while
          initializing module permissions</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) ERROR:
          &lt;core&gt; [pt.c:332]: ERROR: fork_process(): init_child
          failed for&nbsp; process 2, pid 2616, ""</div>
        <div style="margin: 0px; font: 12px Helvetica;">&nbsp;2(2616) :
          &lt;core&gt; [main.c:1439]: main_loop: Cannot fork</div>
      </div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>Here is a snapshot of the configuration:</div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>
        <div>#!ifdef WITH_SQL</div>
        <div>loadmodule "db_postgres.so"</div>
        <div>#loadmodule "sqlops"</div>
        <div>#!endif</div>
        <div>loadmodule "mi_fifo.so"</div>
        <div>loadmodule "kex.so"</div>
        <div>loadmodule "tm.so"</div>
        <div>loadmodule "tmx.so"</div>
        <div>loadmodule "sl.so"</div>
        <div>loadmodule "rr.so"</div>
        <div>loadmodule "pv.so"</div>
        <div>loadmodule "avpops.so"</div>
        <div>loadmodule "maxfwd.so"</div>
        <div>loadmodule "usrloc.so"</div>
        <div>loadmodule "registrar.so"</div>
        <div>loadmodule "textops.so"</div>
        <div>loadmodule "uri_db.so"</div>
        <div>loadmodule "siputils.so"</div>
        <div>loadmodule "xlog.so"</div>
        <div>loadmodule "sanity.so"</div>
        <div>loadmodule "ctl.so"</div>
        <div>loadmodule "mi_rpc.so"</div>
        <div>loadmodule "acc.so"</div>
        <div>loadmodule "enum.so"</div>
        <div><br>
        </div>
        <div># ----------------- drouting module
          -------------------------------</div>
        <div>loadmodule "drouting.so"</div>
        <div><br>
        </div>
        <div># ----------------- permissions module
          -------------------------------</div>
        <div>loadmodule "permissions.so"</div>
      </div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>...</div>
      <div>...</div>
      <div>...</div>
      <div><br>
      </div>
      <div>
        <div># ----- drouting params -----</div>
        <div>modparam("drouting", "sort_order", 0)</div>
        <div>modparam("drouting", "use_domain", 1)</div>
        <div>modparam("drouting","db_url",</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;"<a moz-do-not-send="true"
            href="postgres://XXXX:YYYY@192.168.190.150:5432/kamailio">postgres://XXXX:YYYY@192.168.190.150:5432/kamailio</a>")</div>
        <div><br>
        </div>
        <div># ------ permissions ----</div>
        <div>modparam("permissions", "default_allow_file",
          "/usr/local/etc/kamailio/permissions.allow")</div>
        <div>modparam("permissions", "default_deny_file",
          "/usr/local/etc/kamailio/permissions.deny")</div>
        <div>modparam("permissions", "db_url",</div>
        <div>&nbsp;&nbsp; &nbsp; &nbsp;
          &nbsp;<a class="moz-txt-link-rfc2396E" href="mailto:postgres://XXXX:YYYY@192.168.190.150:5432/kamailio">"postgres://XXXX:YYYY@192.168.190.150:5432/kamailio"</a>)</div>
        <div>#modparam("permissions", "db_mode", 1)</div>
      </div>
      <div><br>
      </div>
      <br>
      <div>
        <div style="word-wrap: break-word;">
          <div style="word-wrap: break-word;">
            <div>
              <pre class="moz-signature" cols="72"><font class="Apple-style-span" face="Monaco" size="4"><span class="Apple-style-span" style="font-size: 14px;">
</span></font></pre>
              <pre class="moz-signature" cols="72"><font class="Apple-style-span" face="Monaco" size="4"><span class="Apple-style-span" style="font-size: 14px;">Commenting </span></font><span class="Apple-style-span" style="font-family: Helvetica; white-space: normal;">loadmodule "drouting.so" or&nbsp;</span>loadmodule "permissions.so"(and modparam) lets all things work perfectly. Together, the error rise :(</pre>
              <pre class="moz-signature" cols="72"><font class="Apple-style-span" face="Monaco" size="4"><span class="Apple-style-span" style="font-size: 14px;">
</span></font></pre>
              <pre class="moz-signature" cols="72"><font class="Apple-style-span" face="Monaco" size="4"><span class="Apple-style-span" style="font-size: 14px;">Thanks a Lot,</span></font></pre>
              <pre class="moz-signature" cols="72"><font class="Apple-style-span" face="Monaco" size="4"><span class="Apple-style-span" style="font-size: 14px;">
</span><span class="Apple-style-span" style="font-size: 14px;">Giorgio Maria Santini</span></font></pre>
              <pre class="moz-signature" cols="72"><font class="Apple-style-span" face="Helvetica"><span class="Apple-style-span" style="white-space: normal;"><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;">
</span></font></span></font></pre>
            </div>
          </div>
          <br class="Apple-interchange-newline">
        </div>
        <br class="Apple-interchange-newline">
        <br class="Apple-interchange-newline">
      </div>
      <br>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
sr-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
Kamailio (OpenSER) Advanced Training
Jan 24-26, 2011, Irvine, CA, USA
<a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a></pre>
  </body>
</html>