Authentication problem using MySQL

I’'m having a problem with jabber clients returning invalid username or password when trying to log in. However if I keep clicking the login button eventually the client will login, password and username are stored in the client.

Once I’'ve managed to get a client to connect I can usually disconnect and reconnect without any problems, however leaving the client disconnected for several minutes starts the problem of not being able to login again.

The same problem exists when trying to login to the admin interface, on both 9090 and 9091, sometimes wildfire returns invalid username or password, continually refreshing the page will eventually achieve a login. This is using IE6 or Firefox 1.5.0.6

I’'ve installed wildfire on 2 different servers one local/test with MySQL 4.0.26 and one remote MySQL 4.1.21, both running Java 1.5.0 8. Local machine runs FC3 while live server runs RedHat ES4

Both installs are clean wildfire 3.0.1 and have been reinstalled a couple of times, they are using MySQL as the database.

I’‘ve tried the clients, Spark, Pandion, neos, Exodus on 2 different computers with and without firewalls. I’‘ve also tried 2 different internet connections, although that doesn’'t explain why the local machine has the same issue.

There are no lines being added to any of the log files, I can telnet to the servers port 5222 and it will respond, also in the admin interface it’'s not showing users left logged in.

netstat shows a connection established between the client and server on port 5222 and wildfire is listening on the ports.

Also once a client is connected it all appears to work flawlessly.

At this point I’'m completely stumped and any ideas of where to look next would be greatly appreciated.

In case I’'ve missed something from the config, wildfire.xml is:

Thanks,

Paul

I’‘m running Wildfire 3.0.1 with Java 1.5.0.7 on my XP and I’‘m getting the same, but I don’‘t suppose it’‘s database related. I’'m using the built in database. With Spark, given the same login and config, at times login fails with invalid username/password error. When it fails, there are some logs displayed on the Wildfire start/stop window:

Error while negotiating TLS

javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

at com.sun.net.ssl.internal.ssl.EngineInputRecord.bytesInCompletePacket(Unknown Source)

at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord(Unknown Source)

at com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap(Unknown Source)

at javax.net.ssl.SSLEngine.unwrap(Unknown Source)

at org.jivesoftware.wildfire.net.TLSStreamHandler.doHandshake(TLSStreamHandler.jav a:277)

at org.jivesoftware.wildfire.net.TLSStreamHandler.start(TLSStreamHandler.java:223)

at org.jivesoftware.wildfire.net.SocketConnection.startTLS(SocketConnection.java:1 73)

at org.jivesoftware.wildfire.net.SocketReadingMode.negotiateTLS(SocketReadingMode. java:72)

at org.jivesoftware.wildfire.net.BlockingReadingMode.readStream(BlockingReadingMod e.java:126)

at org.jivesoftware.wildfire.net.BlockingReadingMode.run(BlockingReadingMode.java: 62)

at org.jivesoftware.wildfire.net.SocketReader.run(SocketReader.java:123)

at java.lang.Thread.run(Unknown Source)

Connection closed before session established

Socket[addr=/192.168.0.141,port=2226,localport=5222]

Seems I lied about nothing in the logs, I just cleaned everything off and started again this time the following is showing in the Warn log:

2006.08.29 11:47:28 SaslException

javax.security.sasl.SaslException: DIGEST-MD5: IO error acquiring password Caused by java.io.IOException: org.jivesoftware.wildfire.user.UserNotFoundException

at com.sun.security.sasl.digest.DigestMD5Server.validateClientResponse(Unknown Source)

at com.sun.security.sasl.digest.DigestMD5Server.evaluateResponse(Unknown Source)

at org.jivesoftware.wildfire.net.SASLAuthentication.handle(SASLAuthentication.java :248)

at org.jivesoftware.wildfire.net.SocketReadingMode.authenticateClient(SocketReadin gMode.java:117)

at org.jivesoftware.wildfire.net.BlockingReadingMode.readStream(BlockingReadingMod e.java:136)

at org.jivesoftware.wildfire.net.BlockingReadingMode.run(BlockingReadingMode.java: 62)

at org.jivesoftware.wildfire.net.SocketReader.run(SocketReader.java:123)

at java.lang.Thread.run(Unknown Source)

Caused by: java.io.IOException: org.jivesoftware.wildfire.user.UserNotFoundException

at org.jivesoftware.wildfire.net.XMPPCallbackHandler.handle(XMPPCallbackHandler.ja va:73)

… 8 more

Spark generated the following error.log:

SASL authentication failed:

at org.jivesoftware.smack.SASLAuthentication.authenticate(SASLAuthentication.java: 205)

at org.jivesoftware.smack.XMPPConnection.login(XMPPConnection.java:426)

at com.jivesoftware.LoginDialog$LoginPanel.login(LoginDialog.java:608)

at com.jivesoftware.LoginDialog$LoginPanel.access$400(LoginDialog.java:195)

at com.jivesoftware.LoginDialog$3.construct(LoginDialog.java:514)

at com.jivesoftware.spark.util.SwingWorker$2.run(SwingWorker.java:121)

at java.lang.Thread.run(Unknown Source)

After a fair amount of trial and error it seems my problem was to do with section.

I had left it as the default 1.0 but have now set it to 0.0, every login attempt be it via the admin interface or via a client works.

I’‘m not too sure what this setting does or if setting it to 0.0 is a bad thing, but I’'ll probably find out one way or the other eventually.

Hi,

the “1.0” means one day, so it seems that you have a firewall or something else which is closing open TCP connections between your Wildfire server and the database. So setting it to 1 hour (~ 0.04) or even lower could help to solve this problem, setting it to 0.0 may cause performance problems. Anyhow 0.0 could currently be the only valid option for you as Wildfire does re-use the connections depending on their ID and is - if I remember right - not using round-robin.

LG

Both Wildfire and MySQL are on the same server and to be 100% sure I did disable all firewalls. It has to be either MySQL or Wildfire that is closing the connection.

I did try 0.04 as suggested, thanks, but no luck the connection is dropped after a few minutes and logins fail again.

It seems that MySQL had wait_timeout set too low and so the connections from Wildfire were being terminated.

Having now reset MySQL to use the default 8 hours and changed the default connection timeout of Wildfire from 1 day to 0.3 (7.2 hours) all seems to be running smoothly.