ejabberd - Comments for "ODBC connection failing to reconnect with 2.0.3 (EJAB-764)" https://www.ejabberd.im/node/3407 en ODBC reconnection works. https://www.ejabberd.im/node/3407#comment-54042 <p>It appears that the reconnection capability is built into the pgsql module and not the generic odbc module.</p> <p>Once I included the pgsql modules and adjusted the config, it worked fine.</p> <p>Thanks again for your comments.</p> Sat, 28 Feb 2009 01:14:58 +0000 karvinm comment 54042 at https://www.ejabberd.im Could it be OTP R11B-0? https://www.ejabberd.im/node/3407#comment-54041 <p>Thanks for your reply.</p> <p>The ODBC connection syntax should be correct. You can see that same format in the .cfg under "ODBC compatible or MSSQL Server".</p> <p>Unlike you, when I stop postgres, there are no error messages in the ejabberd.log</p> <p>I'll compile R12B-5 and see if that makes a difference.</p> Thu, 26 Feb 2009 19:55:18 +0000 karvinm comment 54041 at https://www.ejabberd.im Works for me using mysql https://www.ejabberd.im/node/3407#comment-54040 <div class="quote-msg"> <div class="quote-author"><em>karvinm</em> wrote:</div> <p>I installed 2.0.3 with OTP R11B-0 and connected it to our Postgresql Db and all works fine, </p></div> <p>Maybe R11B-0 is too old? You could try with R11B-5, or R12B-5, or anything newer if a package is available for your system.<br /> If you are lazy to compile Erlang yourself and you want to know if the problem could be fixed by using a more recent Erlang version, you can try to install ejabberd using ejabberd 2.0.3 binary installer from ProcessOne. It includes Erlang R12B-5, ejabberd, mysql and pgsql drivers.</p> <div class="quote-msg"> <div class="quote-author"><em>karvinm</em> wrote:</div> <p> but when I restart postgresql without restarting ejabberd, ejabberd won't recognize that it's connection has been broken and fails all subsequent attempts by clients to login. </p></div> <p>It reconnects correctly for me using mysql. I don't have a pgsql server to test.</p> <div class="quote-msg"> <div class="quote-author"><em>karvinm</em> wrote:</div> <p>{auth_method, odbc}{odbc_server, "DSN=mydsn;UID=myuser;PWD=mypassword;DATABASE=mydatabase"} </p></div> <p>This syntax is wrong, and I'm sure ejabberd didn't start with such line in ejabberd.cfg</p> <div class="quote-msg"> <div class="quote-author"><em>karvinm</em> wrote:</div> <p>{odbc_keepalive_interval, 120} </p></div> <p>I didn't need to change this option.</p> <p>I installed ejabberd 2.0.3, Erlang/OTP R12B-5, mysql from ejabberd-modules SVN.</p> <p>Configuration of ejabberd: the default, with this change:</p> <pre> {auth_method, odbc}. {odbc_server, {mysql, "localhost", "ejadb", "ejauser", "ejapass"}}. </pre><p> I create an account and login. All correct up to here.</p> <p>Now I stop the MySQL server:</p> <pre> root@localhost:~# /etc/init.d/mysql stop Stopping MySQL database server: mysqld. </pre><p> Immediately, ejabberd starts complaining in ejabberd.log:</p> <pre> ... =ERROR REPORT==== 26-Feb-2009::09:49:58 === E(&lt;0.711.0&gt;:ejabberd_odbc:385) : mysql_conn: Failed connecting to "localhost":3306 : {error, "connect failed : {error,econnrefused}"} =ERROR REPORT==== 26-Feb-2009::09:49:58 === E(&lt;0.710.0&gt;:ejabberd_odbc:347) : MySQL connection failed: connect_failed Waiting 30 seconds before retrying... =ERROR REPORT==== 26-Feb-2009::09:49:58 === E(&lt;0.646.0&gt;:ejabberd_odbc:385) : mysql_conn: Received unknown signal, exiting =INFO REPORT==== 26-Feb-2009::09:49:58 === I(&lt;0.646.0&gt;:ejabberd_odbc:383) : Closing connection #Port&lt;0.3662&gt;: ok =ERROR REPORT==== 26-Feb-2009::09:49:58 === ** Generic server &lt;0.645.0&gt; terminating ** Last message in was {'DOWN',#Ref&lt;0.0.0.9599&gt;,process,&lt;0.646.0&gt;,normal} ** When Server state == {state,&lt;0.646.0&gt;,mysql} ** Reason for termination == ** connection_dropped =CRASH REPORT==== 26-Feb-2009::09:49:58 === crasher: pid: &lt;0.645.0&gt; registered_name: [] exception exit: connection_dropped in function gen_server:terminate/6 initial call: ejabberd_odbc:init/1 ancestors: [ejabberd_odbc_sup_localhost,ejabberd_sup,&lt;0.38.0&gt;] messages: [] links: [&lt;0.308.0&gt;] dictionary: [] trap_exit: false status: running heap_size: 233 stack_size: 23 reductions: 472 neighbours: =ERROR REPORT==== 26-Feb-2009::09:49:58 === E(&lt;0.661.0&gt;:ejabberd_odbc:385) : mysql_conn: Received unknown signal, exiting =INFO REPORT==== 26-Feb-2009::09:49:58 === I(&lt;0.661.0&gt;:ejabberd_odbc:383) : Closing connection #Port&lt;0.3667&gt;: ok </pre><p> If I logout and login again the Jabber client, it fails.</p> <p>Then I start MySQL:</p> <pre> root@localhost:~# /etc/init.d/mysql start Starting MySQL database server: mysqld. Checking for corrupt, not cleanly closed and upgrade needing tables.. </pre><p> A few seconds later, ejabberd reports in ejabberd.log a lot of stuff, like:</p> <pre> =PROGRESS REPORT==== 26-Feb-2009::10:16:40 === supervisor: {local,ejabberd_odbc_sup_localhost} started: [{pid,&lt;0.821.0&gt;}, {name,5}, {mfa,{ejabberd_odbc,start_link,["localhost",30000]}}, {restart_type,transient}, {shutdown,brutal_kill}, {child_type,worker}] </pre><p> Now I login again correctly.</p> Thu, 26 Feb 2009 09:27:08 +0000 mfoss comment 54040 at https://www.ejabberd.im