Logging Error: Error rotating file

Hi,

The open fire error log file has multiple errors on the index folder and when the log file has reached its capacity, it rotates to warn/debug/error_1.log but the warn/debug/error.log file doesn’t gets created.

The logs gets written inot the nohup.out as:

java.io.IOException: Cannot read directory /opt/openfire/3.6.4/index/wgp1
at org.apache.lucene.store.FSDirectory.create(FSDirectory.java:194)
at org.apache.lucene.store.FSDirectory.init(FSDirectory.java:177)
at org.apache.lucene.store.FSDirectory.getDirectory(FSDirectory.java:141)
at org.apache.lucene.store.FSDirectory.getDirectory(FSDirectory.java:117)
at org.apache.lucene.index.IndexWriter.(IndexWriter.java:204)
at org.jivesoftware.xmpp.workgroup.search.ChatSearchManager.getWriter(ChatSearchMa nager.java:942)
at org.jivesoftware.xmpp.workgroup.search.ChatSearchManager.rebuildIndex(ChatSearc hManager.java:700)
at org.jivesoftware.xmpp.workgroup.search.ChatSearchManager.rebuildIndex(ChatSearc hManager.java:444)
at org.jivesoftware.xmpp.workgroup.search.ChatSearchManager.updateIndex(ChatSearch Manager.java:462)
at org.jivesoftware.xmpp.workgroup.WorkgroupManager$5.run(WorkgroupManager.java:53 2)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

java.io.IOException: Too many open files
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(Unknown Source)
at org.apache.lucene.store.FSDirectory$1.obtain(FSDirectory.java:363)
at org.apache.lucene.store.Lock.obtain(Lock.java:51)
at org.apache.lucene.index.IndexWriter.(IndexWriter.java:254)
at org.apache.lucene.index.IndexWriter.(IndexWriter.java:204)
at org.jivesoftware.xmpp.workgroup.search.ChatSearchManager.getWriter(ChatSearchMa nager.java:942)
at org.jivesoftware.xmpp.workgroup.search.ChatSearchManager.updateIndex(ChatSearch Manager.java:471)
at org.jivesoftware.xmpp.workgroup.search.ChatSearchManager$1.run(ChatSearchManage r.java:1000)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Logging Error: Error rotating file
java.io.FileNotFoundException: /opt/openfire/3.6.4/logs/debug.log (Too many open files)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.(Unknown Source)
at java.io.FileOutputStream.(Unknown Source)
at org.jivesoftware.util.log.output.io.FileTarget.openFile(FileTarget.java:84)
at org.jivesoftware.util.log.output.io.rotate.RotatingFileTarget.rotate(RotatingFi leTarget.java:53)
at org.jivesoftware.util.log.output.io.rotate.RotatingFileTarget.write(RotatingFil eTarget.java:68)
at org.jivesoftware.util.log.output.AbstractOutputTarget.doProcessEvent(AbstractOu tputTarget.java:81)
at org.jivesoftware.util.log.output.AbstractTarget.processEvent(AbstractTarget.jav a:62)
at org.jivesoftware.util.log.Logger.fireEvent(Logger.java:535)
at org.jivesoftware.util.log.Logger.output(Logger.java:515)
at org.jivesoftware.util.log.Logger.output(Logger.java:501)
at org.jivesoftware.util.log.Logger.debug(Logger.java:102)
at org.jivesoftware.util.Log.debug(Log.java:219)
at org.jivesoftware.openfire.component.InternalComponentManager$2.debug(InternalCo mponentManager.java:382)
at org.jivesoftware.xmpp.workgroup.dispatcher.RoundRobinDispatcher.validateAgent(R oundRobinDispatcher.java:400)
at org.jivesoftware.xmpp.workgroup.dispatcher.RoundRobinDispatcher.getBestNextAgen t(RoundRobinDispatcher.java:367)
at org.jivesoftware.xmpp.workgroup.dispatcher.RoundRobinDispatcher.dispatch(RoundR obinDispatcher.java:150)

Logging Error: Writing event to closed stream.
Logging Error: Writing event to closed stream.
Logging Error: Writing event to closed stream.
Logging Error: Writing event to closed stream.
Logging Error: Writing event to closed stream.
Logging Error: Writing event to closed stream.
Logging Error: Writing event to closed stream.
Logging Error: Writing event to closed stream.
Logging Error: Writing event to closed stream.

On restart of the server, the error.log, warn.log adn debug.log files get created but once they reach their cap size, the same error appears.

What is it that I am missing here?

Hi,

“java.io.IOException: Too many open files” is the critical error. You need to increase the open file limit (ulimit -n) for the Openfire process, likely in /etc/security/limits.conf

If it runs as user “jive” then you may want to add these two lines:

jive          hard     nofile          2048
jive          soft     nofile          2048

Anyhow your users should also have some problems as this error does likely occur more often.

LG

yes, users get errors and the log file builds rapidly. Finally, the error.log, warn.log and debug.log file doesn’t get created after the file rotation.