Bukkit too many open files error ?!

Discussion in 'Bukkit Help' started by Val-Dim, Aug 11, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Val-Dim

    I recently started having various errors on my CraftBukkit server-one I've already posted a thread about, and this one-it says it has too many open files and starts behaving abnormally.
    System-Debian 6.0.5
    Java packet-openJDK-6-jre
    Error log:

    2012-08-10 17:05:23 [SEVERE] java.lang.ArrayIndexOutOfBoundsException
    2012-08-10 17:05:23 [SEVERE] java.lang.ArrayIndexOutOfBoundsException
    2012-08-10 17:05:23 [SEVERE] java.lang.ArrayIndexOutOfBoundsException
    2012-08-10 17:05:23 [SEVERE] java.lang.ArrayIndexOutOfBoundsException
    2012-08-10 17:05:23 [SEVERE] java.lang.ArrayIndexOutOfBoundsException
    2012-08-10 17:05:23 [SEVERE] java.lang.ArrayIndexOutOfBoundsException
    2012-08-10 17:05:23 [SEVERE] java.lang.ArrayIndexOutOfBoundsException
    2012-08-10 17:05:23 [SEVERE] java.lang.ArrayIndexOutOfBoundsException
    2012-08-10 17:05:23 [SEVERE] java.lang.ArrayIndexOutOfBoundsException
    2012-08-10 17:05:23 [SEVERE] java.lang.ArrayIndexOutOfBoundsException
    2012-08-10 17:05:23 [SEVERE] java.lang.ArrayIndexOutOfBoundsException
    2012-08-10 17:05:23 [SEVERE] java.io.FileNotFoundException: ./ColdCraft/region/r.0.-2.mca (Too many open files)
    2012-08-10 17:05:23 [SEVERE] at java.io.RandomAccessFile.open(Native Method)
    2012-08-10 17:05:23 [SEVERE] at java.io.RandomAccessFile.<init>(RandomAccessFile.java:233)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.RegionFile.<init>(SourceFile:97)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.RegionFileCache.a(SourceFile:65)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.RegionFileCache.d(SourceFile:95)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.ChunkRegionLoader.a(ChunkRegionLoader.java:144)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.ChunkRegionLoader.c(ChunkRegionLoader.java:134)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.FileIOThread.b(SourceFile:29)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.FileIOThread.run(SourceFile:22)
    2012-08-10 17:05:23 [SEVERE] at java.lang.Thread.run(Thread.java:636)
    2012-08-10 17:05:23 [SEVERE] java.lang.NullPointerException
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.RegionFile.a(SourceFile:259)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.ChunkBuffer.close(SourceFile:230)
    2012-08-10 17:05:23 [SEVERE] at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:166)
    2012-08-10 17:05:23 [SEVERE] at java.io.FilterOutputStream.close(FilterOutputStream.java:160)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.ChunkRegionLoader.a(ChunkRegionLoader.java:147)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.ChunkRegionLoader.c(ChunkRegionLoader.java:134)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.FileIOThread.b(SourceFile:29)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.FileIOThread.run(SourceFile:22)
    2012-08-10 17:05:23 [SEVERE] at java.lang.Thread.run(Thread.java:636)
    2012-08-10 17:05:23 [SEVERE] java.lang.NullPointerException
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.RegionFile.a(SourceFile:259)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.ChunkBuffer.close(SourceFile:230)
    2012-08-10 17:05:23 [SEVERE] at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:166)
    2012-08-10 17:05:23 [SEVERE] at java.io.FilterOutputStream.close(FilterOutputStream.java:160)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.ChunkRegionLoader.a(ChunkRegionLoader.java:147)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.ChunkRegionLoader.c(ChunkRegionLoader.java:134)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.FileIOThread.b(SourceFile:29)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.FileIOThread.run(SourceFile:22)
    2012-08-10 17:05:23 [SEVERE] at java.lang.Thread.run(Thread.java:636)
    2012-08-10 17:05:23 [SEVERE] java.lang.NullPointerException
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.RegionFile.a(SourceFile:259)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.ChunkBuffer.close(SourceFile:230)
    2012-08-10 17:05:23 [SEVERE] at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:166)
    2012-08-10 17:05:23 [SEVERE] at java.io.FilterOutputStream.close(FilterOutputStream.java:160)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.ChunkRegionLoader.a(ChunkRegionLoader.java:147)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.ChunkRegionLoader.c(ChunkRegionLoader.java:134)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.FileIOThread.b(SourceFile:29)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.FileIOThread.run(SourceFile:22)
    2012-08-10 17:05:23 [SEVERE] at java.lang.Thread.run(Thread.java:636)
    2012-08-10 17:05:23 [SEVERE] java.lang.NullPointerException
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.RegionFile.a(SourceFile:259)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.ChunkBuffer.close(SourceFile:230)
    2012-08-10 17:05:23 [SEVERE] at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:166)
    2012-08-10 17:05:23 [SEVERE] at java.io.FilterOutputStream.close(FilterOutputStream.java:160)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.ChunkRegionLoader.a(ChunkRegionLoader.java:147)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.ChunkRegionLoader.c(ChunkRegionLoader.java:134)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.FileIOThread.b(SourceFile:29)
    2012-08-10 17:05:23 [SEVERE] at net.minecraft.server.FileIOThread.run(SourceFile:22)

    And it goes on with the same error, then went through:

    2012-08-10 17:08:45 [SEVERE] net.minecraft.server.ExceptionWorldConflict: Failed to check session lock, aborting
    2012-08-10 17:08:45 [SEVERE] at net.minecraft.server.WorldNBTStorage.checkSession(WorldNBTStorage.java:76)
    2012-08-10 17:08:45 [SEVERE] at net.minecraft.server.World.B(World.java:2464)
    2012-08-10 17:08:45 [SEVERE] at net.minecraft.server.ChunkRegionLoader.a(ChunkRegionLoader.java:82)
    2012-08-10 17:08:45 [SEVERE] at net.minecraft.server.ChunkProviderServer.saveChunk(ChunkProviderServer.java:160)
    2012-08-10 17:08:45 [SEVERE] at net.minecraft.server.ChunkProviderServer.unloadChunks(ChunkProviderServer.java:248)
    2012-08-10 17:08:45 [SEVERE] at net.minecraft.server.WorldServer.doTick(WorldServer.java:158)
    2012-08-10 17:08:45 [SEVERE] at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:560)
    2012-08-10 17:08:45 [SEVERE] at net.minecraft.server.DedicatedServer.q(DedicatedServer.java:212)
    2012-08-10 17:08:45 [SEVERE] at net.minecraft.server.MinecraftServer.p(MinecraftServer.java:476)
    2012-08-10 17:08:45 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:408)
    2012-08-10 17:08:45 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:539)

    Then, it started spamming this:

    2012-08-10 17:08:45 [WARNING] DSCT: Too many open files
    2012-08-10 17:08:45 [WARNING] DSCT: Too many open files
    2012-08-10 17:08:45 [WARNING] DSCT: Too many open files
    2012-08-10 17:08:45 [WARNING] DSCT: Too many open files
    2012-08-10 17:08:45 [WARNING] DSCT: Too many open files
    2012-08-10 17:08:45 [WARNING] DSCT: Too many open files
    2012-08-10 17:08:45 [WARNING] DSCT: Too many open files
    2012-08-10 17:08:45 [WARNING] DSCT: Too many open files
    2012-08-10 17:08:45 [WARNING] DSCT: Too many open files
    2012-08-10 17:08:45 [WARNING] DSCT: Too many open files
    2012-08-10 17:08:45 [WARNING] DSCT: Too many open files

    And sometimes there appeared the previous error messages.
    What could this error be caused by and how could it be fixed?

    Plugins:


    ChatManager
    ChestShop
    Essentials
    EssentialsChat
    EssentialsProtect
    EssentialsSpawn
    FoundDiamonds
    Futbol
    iConomy 6
    Jobs
    Lockette
    LogBlock
    Modifyworld
    NoMulti
    PermissionsEx
    PvPToggle
    Regios
    Residence
    TempBan
    TimedMessages
    VanishNoPacket
    Vault
    WorldEdit
    WorldGuard
    WorldSaver
    xAuth

    Link to thread about the [SEVERE] java.lang.ArrayIndexOutOfBoundsException error:
    http://forums.bukkit.org/threads/se...tion-3159265-server-crash.92266/#post-1273826

    Seriously, I have no idea why this happens as I haven't noticed any plugins that could open an excessive amount of files. I thought that increasing the system's limit of open files would help, but it turns out that there is no such limit. Probably Java? Help!

    bump

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 27, 2016
  2. Hello, I have same problem here.
     
  3. Offline

    Val-Dim

    Really? I thought I had the only topic around here with this error...
    Got any solution?
     
  4. Offline

    Val-Dim

  5. Offline

    confuserr

    Either a plugin not closing files resulting in too many being opened (when this happens, use lsof to see whats opened), or your file limit is too low. I believe the default is 1024. Do a google search on how to increase the max file limits in linux.
     
  6. Offline

    zipfe

    Well you are running out of file descriptors. It's probably a plugin opening files, and never closing them.

    Check your current available fds with
    cat /proc/sys/fs/file-max

    Also, to find out which files are open, do
    lsof –p and lsof –p | wc –l for a count.
     
  7. Offline

    Val-Dim

    file-max is 205193.
    Bout the files, I only managed to find that xAuth had six open DBVERSION files-nothing else suspicious.
    I'll try it out though. I'm not sure it's this, as the file limit is... well, a lot.
    EDIT: Found out a problematic file while attempting to cause such crash with my users: the server has a crapload of instances of r.0.-2.mca and does not close them. Removed the file, it seems to have fixed the error. Thanks a lot man!
     
  8. Offline

    xMasterProx

    same problem
     
  9. Offline

    k2ska

    Same ... -.-
     
  10. Offline

    xUtuber117x

  11. Offline

    Pixiio

  12. Offline

    CubieX

    We got this error today. CB 1.3.2-R1.0
     
  13. Offline

    Ghozer

    I am assuming you are running linux...

    you can check your hard and soft limits by typing the following commands
    ulimit -Hn
    ulimit -Sn

    my guess is, these will be 1024
    If you do not have root user access, then you will need to contact your host, ask them to increse the hard and soft file limits for your user/domain.

    4096 should be more than enough.

    if you are a root user,

    edit /etc/sysctl.conf
    and add fs.file-max = 65535

    then edit /etc/security/limits.conf
    and add...

    USERNAME soft nofile 4096
    USERNAME soft nofile 8192

    (replace username with your minecraft user's username, or use * to apply to all users)

    reboot your server, and this should solve your problem.
     
    sfxworks likes this.
  14. Offline

    PatrickFreed

    Sorry to bump and old topic but do you mean to restart the box itself or just restart the minecraft server.
     
  15. Offline

    Lolmewn

    You could just restart both, to be sure. I think he means the actual box, since they're file system changes.
     
  16. Offline

    PatrickFreed

    These settings were already like this (I rebooted) and ulimit -Hn still prints 1024...
     
  17. Offline

    MinecraftTLC

    The problem is NoCheat. I took it off and it worked fine after that. I instead put on Anti-Cheat.
     
Thread Status:
Not open for further replies.

Share This Page