<html><body bgcolor="#FFFFFF"><div><br><br><br>fwd to the list - reply all failed in first place ...</div><div><br></div><div></div><blockquote type="cite"><div>Hello,<br><br>the module connects in mod init to check the table version, otherwise it does not do any message storage related operations with the database. It should work fine at runtime even if mod init does not connect to db.<br>
<br>But it is strange of mod init fails but child init goes on. Do you have a firewall with policies related to active connections (rate of new connections)?<br><br>Cheers,<br>Daniel<br><br><div class="gmail_quote">On Sat, Mar 3, 2012 at 6:16 PM, Krishna Kurapati <span dir="ltr">&lt;<a href="mailto:kkurapat@gmail.com"><a href="mailto:kkurapat@gmail.com">kkurapat@gmail.com</a></a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Further investigation into the issue revealed that the db_conn in the module_init is failing... When I commented out the code,<div>
the module is initialized ok. Not sure if this is will fine.</div><div><br></div><div><div>
#if 0</div><div>&nbsp; &nbsp; &nbsp; &nbsp; db_con = msilo_dbf.init(&amp;ms_db_url);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if (!db_con)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LM_ERR("failed to connect to the database\n");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return -1;</div>

<div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; if(db_check_table_version(&amp;msilo_dbf, db_con, &amp;ms_db_table, S_TABLE_VERSION) &lt; 0) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LM_ERR("error during table version check.\n");</div>

<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return -1;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if(db_con)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; msilo_dbf.close(db_con);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; db_con = NULL;</div><div>#endif</div><div><br></div><div>Is the module not suppose to connect to database in the module init?</div>

<div><br></div><div>Thanks</div><div><br></div><br><div class="gmail_quote">On Sat, Mar 3, 2012 at 10:13 AM, Krishna Kurapati <span dir="ltr">&lt;<a href="mailto:kkurapat@gmail.com" target="_blank"><a href="mailto:kkurapat@gmail.com">kkurapat@gmail.com</a></a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Hi,</div><div><br></div>Thanks for the response. I looked at the DBURL and it looked just fine. I wanted to test and see if the module is reading the config<div>

param or not, I deliberately changed it to&nbsp;</div><div><br>
</div><div>modparam("msilo", "db_url", "mysql://root:xxxxx@localhost/openser");</div><div><br></div><div>When I ran it, the logs shows the user as 'openser' not the 'root' that I gave in config param. May be somewhere in the code,&nbsp;</div>


<div>db_url is being overwritten by&nbsp;DEFAULT_DB_URL.</div><div><br></div><div><div>0(28806) DEBUG: db_mysql [km_my_con.c:94]: opening connection: mysql://xxxx:xxxx@localhost/openser</div><div>&nbsp;0(28806) ERROR: db_mysql [km_my_con.c:109]: driver error: Access denied for user 'openser'@'localhost' (using password: YES)</div>


<div>&nbsp;0(28806) ERROR: &lt;core&gt; [db.c:312]: could not add connection to the pool 0(28806) ERROR: msilo [msilo.c:365]: failed to connect to the database</div><div><br></div><div>Thanks</div><div>Krish Kura</div><div><div>

<br><div class="gmail_quote">
On Sat, Mar 3, 2012 at 5:14 AM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com" target="_blank"><a href="mailto:miconda@gmail.com">miconda@gmail.com</a></a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Hello,<br>
    <br>
    the error says the username, password or IP address are invalid to
    connect to mysql -- access denied. There does not seem like being
    other connections using same db_url, check for typos in db_url
    parameter.<br>
    <br>
    Cheers,<br>
    Daniel<div><div><br>
    <br>
    <br>
    On 3/3/12 12:39 AM, Krishna Kurapati wrote:
    </div></div><blockquote type="cite"><div><div>Hi all,
      <div><br>
      </div>
      <div>I am trying to use msilo module from modules_k. Unfortunately
        it if failing during DB initialization.</div>
      <div>Other modules are initializing fine. I am using Kamailio
        3.2.2.</div>
      <div><br>
      </div>
      <div>Not sure why the connection is not found. I tried to increase
        the MAX mysql connections to 250. I see the</div>
      <div>same error after I increase the connections.</div>
      <div><br>
      </div>
      <div>The config file is pretty standard:</div>
      <div><br>
      </div>
      <div>loadmodule "msilo.so"</div>
      <div>
        <div>modparam("msilo", "add_date", 0);</div>
        <div>modparam("msilo", "db_url", DBURL); &nbsp;# The DBURL works for
          other modules...</div>
      </div>
      <div><br>
      </div>
      <div>Here is the Log output:</div>
      <div><br>
      </div>
      <div>
        <div>0(14115) DEBUG: &lt;core&gt; [cfg.y:1684]: loading module
          msilo.so</div>
        <div>&nbsp;0(14115) DEBUG: &lt;core&gt; [sr_module.c:557]:
          load_module: trying to load
          &lt;/usr/local/kamailio-3.2.2/lib64/kamailio/modules_k/msilo.so&gt;</div>
      </div>
      <div><br>
      </div>
      <div>.....</div>
      <div><br>
      </div>
      <div>
        <div>0(14117) DEBUG: &lt;core&gt; [sr_module.c:928]: DEBUG:
          init_mod: msilo</div>
        <div>&nbsp;0(14117) DEBUG: &lt;core&gt; [sr_module.c:667]:
          find_export_record: found &lt;db_bind_api&gt; in module
          db_mysql
          [/usr/local/kamailio-3.2.2/lib64/kamailio/modules/db_mysql.so]</div>
        <div>&nbsp;0(14117) DEBUG: &lt;core&gt; [db.c:212]: using db bind api
          for db_mysql</div>
        <div>&nbsp;0(14117) DEBUG: &lt;core&gt; [db.c:299]: connection
          0x7fc20d1ace60 not found in pool</div>
        <div>&nbsp;0(14117) DEBUG: db_mysql [km_my_con.c:94]: opening
          connection: mysql://xxxx:xxxx@localhost/openser</div>
        <div>&nbsp;0(14117) ERROR: db_mysql [km_my_con.c:109]: driver error:
          Access denied for user 'openser'@'localhost' (using password:
          YES)</div>
        <div>&nbsp;0(14117) ERROR: &lt;core&gt; [db.c:303]: could not add
          connection to the pool 0(14117) ERROR: msilo [msilo.c:319]:
          failed to connect to the database</div>
        <div>&nbsp;0(14117) ERROR: &lt;core&gt; [sr_module.c:932]:
          init_mod(): Error while initializing module msilo
          (/usr/local/kamailio-3.2.2/lib64/kamailio/modules_k/msilo.so)</div>
        <div>ERROR: error while initializing modules</div>
      </div>
      <div><br>
      </div>
      <div>Any help?</div>
      <div><br>
      </div>
      <div>Thanks</div>
      <div><br>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank"><a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a></a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank"><a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a></a><span><font color="#888888">
</font></span></pre><span><font color="#888888">
    </font></span></blockquote><span><font color="#888888">
    <br><span class="HOEnZb"><font color="#888888">
    <pre cols="72">-- 
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank"><a href="http://www.asipto.com">http://www.asipto.com</a></a>
<a href="http://linkedin.com/in/miconda" target="_blank"><a href="http://linkedin.com/in/miconda">http://linkedin.com/in/miconda</a></a> -- <a href="http://twitter.com/miconda" target="_blank"><a href="http://twitter.com/miconda">http://twitter.com/miconda</a></a></pre>
  </font></span></font></span></div><span class="HOEnZb"><font color="#888888">

</font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br></font></span></div></div></div>
</blockquote></div><br></div>
</blockquote></div><br><br clear="all"><br>-- <br>Daniel-Constantin Mierla<br>&nbsp; <a href="http://www.asipto.com"><a href="http://www.asipto.com">http://www.asipto.com</a></a><br>
</div></blockquote></body></html>