java.nio.channels.OverlappingFileLockException

QOS.ch JIRA | DK | 4 years ago
  1. 0

    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>

    QOS.ch JIRA | 4 years ago | DK
    java.nio.channels.OverlappingFileLockException
  2. 0

    OverlappingFileLockException in logback

    Stack Overflow | 4 years ago | DarVar
    java.nio.channels.OverlappingFileLockException
  3. 0

    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)

    QOS.ch JIRA | 4 years ago | Kireet Reddy
    java.nio.channels.OverlappingFileLockException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    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)

    QOS.ch JIRA | 4 years ago | Kireet Reddy
    java.nio.channels.OverlappingFileLockException

  1. Reich 4 times, last 1 week ago
1 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.nio.channels.OverlappingFileLockException

    No message provided

    at sun.nio.ch.SharedFileLockTable.checkList()
  2. Java RT
    FileChannel.lock
    1. sun.nio.ch.SharedFileLockTable.checkList(FileLockTable.java:255)
    2. sun.nio.ch.SharedFileLockTable.add(FileLockTable.java:152)
    3. sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:972)
    4. java.nio.channels.FileChannel.lock(FileChannel.java:1052)
    4 frames
  3. Logback Core Module
    AppenderAttachableImpl.appendLoopOnAppenders
    1. ch.qos.logback.core.FileAppender.safeWrite(FileAppender.java:187)
    2. ch.qos.logback.core.FileAppender.writeOut(FileAppender.java:204)
    3. ch.qos.logback.core.OutputStreamAppender.subAppend(OutputStreamAppender.java:212)
    4. ch.qos.logback.core.rolling.RollingFileAppender.subAppend(RollingFileAppender.java:148)
    5. ch.qos.logback.core.OutputStreamAppender.append(OutputStreamAppender.java:103)
    6. ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:88)
    7. ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48)
    7 frames
  4. Logback Classic Module
    Logger.log
    1. ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:280)
    2. ch.qos.logback.classic.Logger.callAppenders(Logger.java:267)
    3. ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:449)
    4. ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:403)
    5. ch.qos.logback.classic.Logger.log(Logger.java:803)
    5 frames
  5. SLF4J Extensions Module
    LoggerWrapper.info
    1. org.slf4j.ext.LoggerWrapper.info(LoggerWrapper.java:490)
    1 frame