Error starting server - Database setup error

Hey everyone,

I just had my server stop responding completely with this error in the admin console:

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.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 retries. The exception from the last attempt is as follows: java.sql.SQLException: error in script file line: 1183 java.io.IOException: java.io.IOException: Unexpected end of command

at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:764)

at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:480)

at org.jivesoftware.openfire.XMPPServer.(XMPPServer.java:212)

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.openfire.starter.ServerStarter.start(ServerStarter.java:113)

at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:58)

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.exe4j.runtime.WinLauncher.main(Unknown Source)

Caused by: java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 retries. The exception from the last attempt is as follows: java.sql.SQLException: error in script file line: 1183 java.io.IOException: java.io.IOException: Unexpected end of command

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

at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:754)

… 16 more

Error starting the server. Please check the log files for more information.

Server halted

Everything was working fine for the past week or so, and all of a sudden this morning it stopped working. I checked the error log, but it looks similar to what I already see:

2012.02.03 10:20:10 org.jivesoftware.openfire.XMPPServer - java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 retries. The exception from the last attempt is as follows: java.sql.SQLException: error in script file line: 1183 java.io.IOException: java.io.IOException: Unexpected end of command

java.lang.IllegalArgumentException: java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 retries. The exception from the last attempt is as follows: java.sql.SQLException: error in script file line: 1183 java.io.IOException: java.io.IOException: Unexpected end of command

at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:764)

at org.jivesoftware.openfire.XMPPServer.start(XMPPServer.java:480)

at org.jivesoftware.openfire.XMPPServer.(XMPPServer.java:212)

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.openfire.starter.ServerStarter.start(ServerStarter.java:113)

at org.jivesoftware.openfire.starter.ServerStarter.main(ServerStarter.java:58)

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.exe4j.runtime.WinLauncher.main(Unknown Source)

Caused by: java.sql.SQLException: ConnectionManager.getConnection() failed to obtain a connection after 11 retries. The exception from the last attempt is as follows: java.sql.SQLException: error in script file line: 1183 java.io.IOException: java.io.IOException: Unexpected end of command

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

at org.jivesoftware.openfire.XMPPServer.verifyDataSource(XMPPServer.java:754)

… 16 more

Can anyone help me out?

You are using the embedded database?

Use a restore of your database folder to get the database working again.

If you don’t have a backup:

Make a temporary backup of the database folder and edit then openfire.script - line 1183. This line may be corrupted.

Reason may be: no space left on device or OutOfMemoryError during checkpoint of the internal database.

If you are using plugins (like monitoring) you may want to disable them and delete the archived messages or migrate to an external database.

Ok - is there a way I can do that without having access to the admin webpanel? I just get 404 not found when I try to launch it.

You can do it all from the command line or within Windows. The embedded database is just a flat file within the openfire installation directory.

How can you edit this from the command line? I have the same problem and I looked through the script and didn’t see any thing that looked like a memory setting. Please help!

I just had the same error and dummy ME does not have a backup of the .script file.

I try to open it and all I see is a blank screen, Tried several programs , even a free script editor.

Any hope in repairing it?

Allan

Is there any way or chance of repairing a corrupt .script file. ??

Mine opens as a blank page. File size is 192Kb