[BUG] Wildfire fails to start on boot-up

Hi,

I found a bug near the top of wildfired file, particularly in this line:

  1. chkconfig: 2345 20 80

The S?? should be given a much lower priority by assigning it to perhaps S85 or more instead of S20 because MySQL - being a favorite database in Wildfire - is given S80 by its provider. At least this is true in MySQL v5.*. So far, I haven’'t seen any problem with K80.

The symtom that I saw with the present assignment was that, at times Wildfire failed to start during boot-up although the terminal showed as “Starting wildfired [[OK]]” (perhaps another bug). Some other times however, the startup succeeded because Wildfire did make another two attempts to reconnect to MySQL in 10 seconds intervals (which is good!). Between the 30 seconds trial, MySQL managed to get started. Hence, a race condition.

There are several people in the forum that complained about not being able to start on boot-up using SysV style, but nobody seemed to have a definite answer. So, perhaps an issue could be created in JIRA.

In the mean time, users of this file will have to change the line to something like:

  1. chkconfig: 2345 85 80

For those who has had the wildfired file in place, they also need to rehash:

%> chkconfig wildfired off

%> chkconfig wildfired on

If they don’'t have the handy chkconfig utility, they would have to remove all S20wildfired in rc2, rc3, rc4 and rc5; and re-softlink wildfired with S85wildfired.

Also, a minor modification in http://wiki.jivesoftware.org/display/WILDFIRE/Linux+Installation+Guide somewhere at:

for i in 2 3 4 5

do

cd $/rc$.d && ln -s $/wildfired S20wildfired

done

Although it’‘s a trivial problem, the effect is troublesome when users can’‘t see the connection with the order of application startup during the boot-up time. When the boot-up is unattended, it’'s a clear service downtime.

Wildfire 3.1 beta 2 doesn’‘t have a fix on this, though it’‘s trivial. Just to verify the bug report, I tried to reproduce the error. Here’'s the printout from error.log (edited for simplicity):

2006.09.20 14:31:18 [org.jivesoftware.database.ConnectionPool.(ConnectionPool.java:108)] Failed to create new connections on startup. Attempt 2 of 3

com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

  • BEGIN NESTED EXCEPTION **

java.net.SocketException

MESSAGE: java.net.ConnectException: Connection refused

STACKTRACE:

java.net.SocketException: java.net.ConnectException: Connection refused

at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)

at com.mysql.jdbc.MysqlIO.(XMPPServer.java:147)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

at java.lang.Class.newInstance(Unknown Source)

at org.jivesoftware.wildfire.starter.ServerStarter.start(ServerStarter.java:88)

at org.jivesoftware.wildfire.starter.ServerStarter.main(ServerStarter.java:49)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)

at com.install4j.runtime.Launcher.main(Unknown Source)

  • END NESTED EXCEPTION **

.

.

.

2006.09.20 14:31:50 org.jivesoftware.database.DefaultConnectionProvider.getConnection(DefaultConnect ionProvider.java:68) Warning: DbConnectionDefaultPool.getConnection() was called before the internal pool has been initialized.

2006.09.20 14:31:50 org.jivesoftware.database.DbConnectionManager.setConnectionProvider(DbConnection Manager.java:452)

java.lang.NullPointerException

at org.jivesoftware.database.DbConnectionManager.setMetaData(DbConnectionManager.j ava:626)

at org.jivesoftware.database.DbConnectionManager.setConnectionProvider(DbConnectio nManager.java:446)

at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager .java:74)

at org.jivesoftware.util.JiveProperties.loadProperties(JiveProperties.java:267)

.

.

.

2006.09.20 14:31:50 org.jivesoftware.database.DefaultConnectionProvider.getConnection(DefaultConnect ionProvider.java:68) Warning: DbConnectionDefaultPool.getConnection() was called before the internal pool has been initialized.

2006.09.20 14:31:50 org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager. java:92) WARNING: ConnectionManager.getConnection() failed to obtain a connection.

2006.09.20 14:31:50 org.jivesoftware.util.JiveProperties.loadProperties(JiveProperties.java:278)

java.lang.NullPointerException

at org.jivesoftware.util.JiveProperties.loadProperties(JiveProperties.java:268)

.

.

.

Here’'s the output from stderror.log:

Database setup or configuration error: Please verify your database settings and check the logs/error.log file for detailed error messages.

java.lang.IllegalArgumentException: java.lang.NullPointerException

at org.jivesoftware.wildfire.XMPPServer.verifyDataSource(XMPPServer.java:621)

at org.jivesoftware.wildfire.XMPPServer.start(XMPPServer.java:369)

at org.jivesoftware.wildfire.XMPPServer.(XMPPServer.java:147)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

at java.lang.reflect.Constructor.newInstance(Unknown Source)

at java.lang.Class.newInstance0(Unknown Source)

at java.lang.Class.newInstance(Unknown Source)

at org.jivesoftware.wildfire.starter.ServerStarter.start(ServerStarter.java:88)

at org.jivesoftware.wildfire.starter.ServerStarter.main(ServerStarter.java:49)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)

at com.install4j.runtime.Launcher.main(Unknown Source)

Caused by: java.lang.NullPointerException

at org.jivesoftware.wildfire.XMPPServer.verifyDataSource(XMPPServer.java:610)

… 16 more

Server halted

JM-841 - it’'s actually more work to create the issue than it will be to solve it.

LG

Is it? I’'m not aware of that. Thanks anyway, LG.