FileNotFoundException: /logs/debug.log (No such file or directory)

Hi,

I am running openfire 3.7.0 succesfully, except for the log files.

I get filenotfound on /logs/debug.log, /logs/info.log, /logs/warn.log, /logs/error.log in /home/xxx/openfire/stderror.log

openfire is installed in

/home/xxx/openfire

and log dir is thereby

/home/xxx/openfire/logs

In the admin console, I have, under properties:

log.directory /home/xxx/openfire/logs

and in my openfire.xml I have:

/home/xxx/openfire/logs

Why does openfire try to write the log files under /logs instead of using my parameters?

Here is the trace:

log4j:ERROR setFile(null,true) call failed.

java.io.FileNotFoundException: /logs/debug.log (No such file or directory)

at java.io.FileOutputStream.openAppend(Native Method)

at java.io.FileOutputStream.(FileOutputStream.java:192)

at java.io.FileOutputStream.(FileOutputStream.java:116)

at org.apache.log4j.FileAppender.setFile(FileAppender.java:290)

at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:194)

at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:164)

at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:257)

at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:285)

at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:17 1)

at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.ja va:184)

at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurat or.java:502)

at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:471)

at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:921)

at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:790)

at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:696)

at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.jav a:471)

at org.apache.log4j.LogManager.(LogManager.java:125)

at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73)

at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:243)

at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:255)

If you can sure that the file is in the location.

The problem will be you did not have permission to open the file.

In MacOS or Linux,use root use to start the application.

sudo ./openfire.sh

In Windows Vista or Windows 7, use “Run as Administrator” to start it!

Good luck!

1 Like

I’m having the exact same issue and it is not a permission issue. Running 3.7.0 on Debian. 2 versions ago (3.6.3) logging was working fine but now I get the “(No such file or directory)” for debug.log, info.log, warn.log, and error.log. Owner/Group is the same as well as the permissions (644). I even set all the log files to 777 to test with no luck.

stderror.log and stdoutt.log gets populated but none of the other files do. Actually, I manually created the other log files because they didn’t even get created initially.

I actually just used the Admin Console Log Viewer and clicked “Clear” for each log file and the time stamp updated with an “ls -l” so it seems “FileNotFoundException” descriptor isn’t very accurate.

–dweez

I have the same fault. There isn’t a permission error. The string is “java.io.FileNotFoundException: /logs/debug.log (No such file or directory)”. And this is correct. There is no directory /logs. The correct directory is /home/xxx/openfire/logs or by me /opt/openfire/logs.

I don’t find any settings that overrides /logs with the correct value. I have fixed it with the creation of the directory /logs. But this isn’t a permanent solution.

Is the path hard coded?

DMOrigin wrote:

Is the path hard coded?

I don’t think so. It works fine on my test server on Windows and also on production server on linux. Early 3.7.0 builds had an issue that logs directory had been created in the root directory (at least on Windows), but then it was fixed. Maybe not for all systems. I’m using tar.gz on linux, just unpack it and run.

I’m using the tar.gz on linux as well on 3.7.0.

Then probably it is not the issue with the installer. Maybe this issue is related to some linux distros. Do you all use Debian? I’m using Arch linux.

Maybe

It could be a misstake at the default value on some systems. So the developers mean “.”/logs/ instead /logs/ . Then it is a relative path under the current running path.

I have filed this as OF-480. Hopefully someone will take a look at this.

I’m still having the same issue with 3.7.1. I’ve tried everything I can think of. I thought maybe I could set a log directory prefences in log4j but I can’t find any conf/pref file for it.

This is getting a little frustrating. Don’t get me wrong wr00t, I appreciate all the development you guys do. This is just me venting a little bit as well as giving a “bump” to let everyone know it’s still going on.

Btw, i’m not a developer myself. And we currently have only one (Guus) developer, who is not very active, so it took half a year to release 3.7.1. So… i think this issue probably won’t get much attention for a long time. Unless someone else will provide a patch.

I modified the “./lib/log4j.xml”, removing the “{$openfireHome}” variable and replacing it with the absolute path to my “./logs/” and now I am getting logs. Seems the Log4J application either receiving the wrong path when it looks up the variable or it isn’t getting a response when it looks up the $openfireHome variable and it’s defaulting to “/log”. Can anyone else having this probably verify this reaction?

^^^^^^

I added the above comment to the Bug Report (http://issues.igniterealtime.org/browse/OF-480) that was made because of this thread.

-dweez

1 Like

I can confirm that

Thanks for this info. If it only requires to change one line in build.xml maybe Daryl will be able to apply such patch to the SVN. I will PM him.

I must not be able to find/have the know-how to use the SVN. I grabbed the openfire_2011-10-22.tar.gz from the nightly builds and tested it but I still had to modify ./lib/log4j.xml to get logs working. On our setup, the account used to run openfire does not have access to / so I can’t tell if it’s still trying to save logs to /logs or not but I assume it is.

How does one find access to the SVN and is this just source files that one would have to compile on their own?

That nightly build was probably before the patch went in. the svn tree is here:

https://svn.igniterealtime.org/svn/repos/openfire/trunk

Ah, thanks Daryl.

Try setting OPENFIRE_HOME before starting it:

cd /path/to/your/openfire

export OPENFIRE_HOME=pwd

bin/openfire start