Authentication failing for all users

After few hours of running ejabberd 2.0 stops accepting authentication from all users. The only error messages in ejabberd log are as the following example:

=ERROR REPORT==== 2008-12-03 17:39:33 ===
** Generic server <0.292.0> terminating
** Last message in was {'DOWN',#Ref<0.0.0.8650>,process,<0.293.0>,normal}
** When Server state == {state,<0.293.0>,mysql}
** Reason for termination ==
** connection_dropped

How can we make ejabbberd accept connections again?
Please help.

You didn't mention, but it

You didn't mention, but it seems you use MySQL for authenticating users, right?

Maybe the message means that the connection to the MySQL server was closed. Who and why closed it? It may be ejabberd, or your server, or TCP due to inactivity.

You can try different values of options odbc_keepalive_interval and odbc_start_interval, maybe that helps to solve your problem. Check the ejabberd Guide for documentation of those options.

Yes it's mySQL and Smack client

Yes we are using mySQL, but setting the odbc_keepalive_interval parameter to 15 minutes didn't help. We have not tried the odbc_start_interval parameter yet.
However we are using Smack client API to connect to ejabberd and we made the following changes marked between the comments in our connection creation:

XMPPConnection con = null;
try {
con = new XMPPConnection(SERVER_ADDRESS, SERVER_PORT);
con.login(loginId, loginPwd, session.getId());
} catch (XMPPException xmppe) {
xmppe.printStackTrace();
// added the following fix
if (con != null) {
con.close();
}
// end addition
}

We are using a slightly older version of Smack from Jive, which does not have the explicit con.connect() API supported by later versions.
We are assuming Smack creates an unlogged in connection every time "new XMPPConnection()" is called and it needs to be closed if login fails. If there are too many login failures ejabberd might have many unlogged in connections open and that is not allowing any more login connections. We had many login failures at our site and that is why we tried this fix, though we can say whether it would work only after observing for few more days.

Any other ideas would be welcome.

Thank you very much for your help.

Syndicate content