Instance could not start due to log4j RollingFileAppender error

Hello

during instance startup we are getting an error for the instance.

Jul 31 20:15:27 instancename tomcat9[278]: 2021-07-31 20:15:27,049 main ERROR Could not create plugin of type class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile: java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@b5b8d00] unable to create manager for [dhis.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@2e5d4d21[pattern=dhis.log%i, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[SizeBasedTriggeringPolicy(size=262144000)]), strategy=DefaultRolloverStrategy(min=1, max=10, useMax=true), advertiseURI=null, layout=* %-5p %d{ISO8601} %m (%F [%t])%n %X{sessionId}, filePermissions=null, fileOwner=null]] java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@b5b8d00] unable to create manager for [dhis.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@2e5d4d21[pattern=dhis.log%i, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[SizeBasedTriggeringPolicy(size=262144000)]), strategy=DefaultRolloverStrategy(min=1, max=10, useMax=true), advertiseURI=null, layout=* %-5p %d{ISO8601} %m (%F [%t])%n %X{sessionId}, filePermissions=null, fileOwner=null]]


Jul 31 20:15:27 instancename tomcat9[278]: 2021-07-31 20:15:27,051 main ERROR Unable to invoke factory method in class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile: java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender

Jul 31 20:15:27 instancename tomcat9[278]: 2021-07-31 20:15:27,058 main ERROR Null object returned for RollingFile in Appenders.

Jul 31 20:15:36 instancename tomcat9[278]:  2021-07-31 20:15:36,942 main ERROR Unable to create file dhis.log java.io.IOException: Read-only file system
Jul 31 20:15:36 instancename tomcat9[278]:         at java.io.UnixFileSystem.createFileExclusively(Native Method)
Jul 31 20:15:36 instancename tomcat9[278]:         at java.io.File.createNewFile(File.java:1023)

lxc container is used for the instance. It is also worth noting that there is a high number of access to the instance through API calls.

any thoughts about why this error is generated.

Thank you
Arafat

Hey, sorry you are facing an issue! Is the LXC Container running NGINX? I don’t think this error log is enough to debug the issue, would you please share your NGINX config settings?

If there’s a problem with the configuration it could cause this issue. And I will make sure to ask for support. Thank you!

Hello Al-Gassim

I made an upgrade and it was resolved.

Many thanks
Arafat

1 Like