java.nio.channels.OverlappingFileLockException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • I have multiple webapps running in tomcat all using logback. As discussed in the documentation, I configured the LoggingContextFilter and ContextDetachingSCL in the web.xml and sifting appender in logback.xml (attached). The only other configuration done is that at app startup some log levels are set programatically based on a separate properties file. When the app is running, I get an OverlappingFileLockException and ClosedChannelException NIO exceptions repeatedly. The stack traces are below. Log message volume is pretty high (2-3 GB log file per day), but iostat shows utilization as very low. After startup, all log messages originate from shared libraries and one particular webapp. ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE-jobs.v1] - Appender [FILE-jobs.v1] failed to append. java.nio.channels.OverlappingFileLockException at java.nio.channels.OverlappingFileLockException at at sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList(FileChannelImpl.java:1166) at at sun.nio.ch.FileChannelImpl$SharedFileLockTable.add(FileChannelImpl.java:1068) at at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:824) at at java.nio.channels.FileChannel.lock(FileChannel.java:860) at at ch.qos.logback.core.FileAppender.safeWrite(FileAppender.java:187) at at ch.qos.logback.core.FileAppender.writeOut(FileAppender.java:204) at at ch.qos.logback.core.OutputStreamAppender.subAppend(OutputStreamAppender.java:212) at at ch.qos.logback.core.rolling.RollingFileAppender.subAppend(RollingFileAppender.java:148) at at ch.qos.logback.core.OutputStreamAppender.append(OutputStreamAppender.java:103) at at ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:88) at at ch.qos.logback.core.sift.SiftingAppenderBase.append(SiftingAppenderBase.java:94) at at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:85) at at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48) at at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:282) at at ch.qos.logback.classic.Logger.callAppenders(Logger.java:269) at at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:470) at at ch.qos.logback.classic.Logger.filterAndLog_1(Logger.java:442) at at ch.qos.logback.classic.Logger.debug(Logger.java:535) ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE-jobs.v1] - IO failure in appender java.nio.channels.ClosedChannelException at java.nio.channels.ClosedChannelException at at sun.nio.ch.FileChannelImpl.ensureOpen(FileChannelImpl.java:88) at at sun.nio.ch.FileChannelImpl.position(FileChannelImpl.java:243) at at ch.qos.logback.core.FileAppender.safeWrite(FileAppender.java:188) at at ch.qos.logback.core.FileAppender.writeOut(FileAppender.java:204) at at ch.qos.logback.core.OutputStreamAppender.subAppend(OutputStreamAppender.java:212) at at ch.qos.logback.core.rolling.RollingFileAppender.subAppend(RollingFileAppender.java:148) at at ch.qos.logback.core.OutputStreamAppender.append(OutputStreamAppender.java:103) at at ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:88) at at ch.qos.logback.core.sift.SiftingAppenderBase.append(SiftingAppenderBase.java:94) at at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:85) at at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48) at at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:282) at at ch.qos.logback.classic.Logger.callAppenders(Logger.java:269) at at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:470) at at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:424) at at ch.qos.logback.classic.Logger.info(Logger.java:644)
    via by Kireet Reddy,
  • I have multiple webapps running in tomcat all using logback. As discussed in the documentation, I configured the LoggingContextFilter and ContextDetachingSCL in the web.xml and sifting appender in logback.xml (attached). The only other configuration done is that at app startup some log levels are set programatically based on a separate properties file. When the app is running, I get an OverlappingFileLockException and ClosedChannelException NIO exceptions repeatedly. The stack traces are below. Log message volume is pretty high (2-3 GB log file per day), but iostat shows utilization as very low. After startup, all log messages originate from shared libraries and one particular webapp. ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE-jobs.v1] - Appender [FILE-jobs.v1] failed to append. java.nio.channels.OverlappingFileLockException at java.nio.channels.OverlappingFileLockException at at sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList(FileChannelImpl.java:1166) at at sun.nio.ch.FileChannelImpl$SharedFileLockTable.add(FileChannelImpl.java:1068) at at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:824) at at java.nio.channels.FileChannel.lock(FileChannel.java:860) at at ch.qos.logback.core.FileAppender.safeWrite(FileAppender.java:187) at at ch.qos.logback.core.FileAppender.writeOut(FileAppender.java:204) at at ch.qos.logback.core.OutputStreamAppender.subAppend(OutputStreamAppender.java:212) at at ch.qos.logback.core.rolling.RollingFileAppender.subAppend(RollingFileAppender.java:148) at at ch.qos.logback.core.OutputStreamAppender.append(OutputStreamAppender.java:103) at at ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:88) at at ch.qos.logback.core.sift.SiftingAppenderBase.append(SiftingAppenderBase.java:94) at at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:85) at at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48) at at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:282) at at ch.qos.logback.classic.Logger.callAppenders(Logger.java:269) at at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:470) at at ch.qos.logback.classic.Logger.filterAndLog_1(Logger.java:442) at at ch.qos.logback.classic.Logger.debug(Logger.java:535) ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE-jobs.v1] - IO failure in appender java.nio.channels.ClosedChannelException at java.nio.channels.ClosedChannelException at at sun.nio.ch.FileChannelImpl.ensureOpen(FileChannelImpl.java:88) at at sun.nio.ch.FileChannelImpl.position(FileChannelImpl.java:243) at at ch.qos.logback.core.FileAppender.safeWrite(FileAppender.java:188) at at ch.qos.logback.core.FileAppender.writeOut(FileAppender.java:204) at at ch.qos.logback.core.OutputStreamAppender.subAppend(OutputStreamAppender.java:212) at at ch.qos.logback.core.rolling.RollingFileAppender.subAppend(RollingFileAppender.java:148) at at ch.qos.logback.core.OutputStreamAppender.append(OutputStreamAppender.java:103) at at ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:88) at at ch.qos.logback.core.sift.SiftingAppenderBase.append(SiftingAppenderBase.java:94) at at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:85) at at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48) at at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:282) at at ch.qos.logback.classic.Logger.callAppenders(Logger.java:269) at at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:470) at at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:424) at at ch.qos.logback.classic.Logger.info(Logger.java:644)
    via by Kireet Reddy,
  • OverlappingFileLockException in logback
    via Stack Overflow by DarVar
    ,
  • I'm hitting the following OverlappingFileLockException in LogBack. Is there any know issues with prudent mode in this version of Logback. logback-classic 1.0.7 logback-core 1.0.7 slf4j-api 1.7.2 slf4j-ext 1.7.2 11:16:59,252 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE_LOG] - Appender [FILE_LOG] failed to append. java.nio.channels.OverlappingFileLockException at java.nio.channels.OverlappingFileLockException at at sun.nio.ch.SharedFileLockTable.checkList(FileLockTable.java:255) at at sun.nio.ch.SharedFileLockTable.add(FileLockTable.java:152) at at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:972) at at java.nio.channels.FileChannel.lock(FileChannel.java:1052) at at ch.qos.logback.core.FileAppender.safeWrite(FileAppender.java:187) at at ch.qos.logback.core.FileAppender.writeOut(FileAppender.java:204) at at ch.qos.logback.core.OutputStreamAppender.subAppend(OutputStreamAppender.java:212) at at ch.qos.logback.core.rolling.RollingFileAppender.subAppend(RollingFileAppender.java:148) at at ch.qos.logback.core.OutputStreamAppender.append(OutputStreamAppender.java:103) at at ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:88) at at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48) at at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:280) at at ch.qos.logback.classic.Logger.callAppenders(Logger.java:267) at at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:449) at at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:403) at at ch.qos.logback.classic.Logger.log(Logger.java:803) at at org.slf4j.ext.LoggerWrapper.info(LoggerWrapper.java:490) <appender name="FILE_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender"> <prudent>true</prudent> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <fileNamePattern>C:/MyLog-%d{yyyy-MM-dd}.%i.log</fileNamePattern> <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> <maxFileSize>100MB</maxFileSize> </timeBasedFileNamingAndTriggeringPolicy> <maxHistory>10</maxHistory> </rollingPolicy> <encoder> <pattern>%d{HH:mm:ss.SSS} [%-20.20(%thread)] %-6level %-30.30logger{0} - [%-12.12(S:%mdc{pucid}]) %msg%n</pattern> </encoder> </appender>
    via by DK,
    • java.nio.channels.OverlappingFileLockException at sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList(FileChannelImpl.java:1166) at sun.nio.ch.FileChannelImpl$SharedFileLockTable.add(FileChannelImpl.java:1068) at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:824) at java.nio.channels.FileChannel.lock(FileChannel.java:860) at ch.qos.logback.core.FileAppender.safeWrite(FileAppender.java:187) at ch.qos.logback.core.FileAppender.writeOut(FileAppender.java:204) at ch.qos.logback.core.OutputStreamAppender.subAppend(OutputStreamAppender.java:212) at ch.qos.logback.core.rolling.RollingFileAppender.subAppend(RollingFileAppender.java:148) at ch.qos.logback.core.OutputStreamAppender.append(OutputStreamAppender.java:103) at ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:88) at ch.qos.logback.core.sift.SiftingAppenderBase.append(SiftingAppenderBase.java:94) at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:85) at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48) at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:282) at ch.qos.logback.classic.Logger.callAppenders(Logger.java:269) at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:470) at ch.qos.logback.classic.Logger.filterAndLog_1(Logger.java:442) at ch.qos.logback.classic.Logger.debug(Logger.java:535)

    Users with the same issue

    Axelo
    1 times, last one,
    Reich
    51 times, last one,
    Unknown visitor1 times, last one,