Server crash

Discussion in 'Bukkit Help' started by black_ixx, Feb 25, 2013.

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

    black_ixx

    Well some days ago my bukkit server crashed because of
    Code:
    2013-02-23 21:29:20 [SEVERE] net.minecraft.server.v1_4_R1.ReportedException: Exception ticking world entities
    2013-02-23 21:29:20 [SEVERE]    at net.minecraft.server.v1_4_R1.MinecraftServer.r(MinecraftServer.java:584)
    2013-02-23 21:29:20 [SEVERE]    at net.minecraft.server.v1_4_R1.DedicatedServer.r(DedicatedServer.java:224)
    2013-02-23 21:29:20 [SEVERE]    at net.minecraft.server.v1_4_R1.MinecraftServer.q(MinecraftServer.java:494)
    2013-02-23 21:29:20 [SEVERE]    at net.minecraft.server.v1_4_R1.MinecraftServer.run(MinecraftServer.java:427)
    2013-02-23 21:29:20 [SEVERE]    at net.minecraft.server.v1_4_R1.ThreadServerApplication.run(SourceFile:849)
    2013-02-23 21:29:20 [SEVERE] Caused by: java.lang.IndexOutOfBoundsException: Index: 28, Size: 28
    2013-02-23 21:29:20 [SEVERE]    at java.util.ArrayList.rangeCheck(ArrayList.java:604)
    2013-02-23 21:29:20 [SEVERE]    at java.util.ArrayList.remove(ArrayList.java:445)
    2013-02-23 21:29:20 [SEVERE]    at net.minecraft.server.v1_4_R1.World.tickEntities(World.java:1216)
    2013-02-23 21:29:20 [SEVERE]    at net.minecraft.server.v1_4_R1.WorldServer.tickEntities(WorldServer.java:445)
    2013-02-23 21:29:20 [SEVERE]    at net.minecraft.server.v1_4_R1.MinecraftServer.r(MinecraftServer.java:580)
    2013-02-23 21:29:20 [SEVERE]    ... 4 more
    2013-02-23 21:29:20 [SEVERE] Encountered an unexpected exception ReportedException
    net.minecraft.server.v1_4_R1.ReportedException: Exception ticking world entities
        at net.minecraft.server.v1_4_R1.MinecraftServer.r(MinecraftServer.java:584)
        at net.minecraft.server.v1_4_R1.DedicatedServer.r(DedicatedServer.java:224)
        at net.minecraft.server.v1_4_R1.MinecraftServer.q(MinecraftServer.java:494)
        at net.minecraft.server.v1_4_R1.MinecraftServer.run(MinecraftServer.java:427)
        at net.minecraft.server.v1_4_R1.ThreadServerApplication.run(SourceFile:849)
    Caused by: java.lang.IndexOutOfBoundsException: Index: 28, Size: 28
        at java.util.ArrayList.rangeCheck(ArrayList.java:604)
        at java.util.ArrayList.remove(ArrayList.java:445)
        at net.minecraft.server.v1_4_R1.World.tickEntities(World.java:1216)
        at net.minecraft.server.v1_4_R1.WorldServer.tickEntities(WorldServer.java:445)
        at net.minecraft.server.v1_4_R1.MinecraftServer.r(MinecraftServer.java:580)
        ... 4 more
    I wrote a detailed thread about it at bukkit forums. My server is using bungeecord, which allows to connect multiple servers with a proxy. Only premium players are allowed to join the server. But because of the fact, that the servers itself need offline mode to enable the proxy to transmit it's packets, the thread was removed.

    Now, today I was just testing my new plugin at the testserver.
    My npc enemy was attacking me with a bow. I was almost death. Only one live left. Then I got shot by the npc. The thing is, that my plugin has detected the death and tried to teleport me to the spawn & sent me a message. Exact at this moment everything was frozen. My lives were not even refreshed. I was just at a frozen server with 1/2 heart left. I've taken a look at my server.log. Again an error named "java.lang.IndexOutOfBoundsException" which caused the crash. It looks like bukkit has tried to remove a "line" of an arraylist, which was not existing. The log showed me, that the lists size was 28 and bukkit has tried to access the 29. line.
    The problem: My testserver is in offline mode aswell because sometimes I need to join with alot of players to test plugins out.

    Server.log:
    Code:
    2013-02-25 20:04:16 [SEVERE] net.minecraft.server.v1_4_R1.ReportedException: Exception ticking world entities
    2013-02-25 20:04:16 [SEVERE]    at net.minecraft.server.v1_4_R1.MinecraftServer.r(MinecraftServer.java:584)
    2013-02-25 20:04:16 [SEVERE]    at net.minecraft.server.v1_4_R1.DedicatedServer.r(DedicatedServer.java:224)
    2013-02-25 20:04:16 [SEVERE]    at net.minecraft.server.v1_4_R1.MinecraftServer.q(MinecraftServer.java:494)
    2013-02-25 20:04:16 [SEVERE]    at net.minecraft.server.v1_4_R1.MinecraftServer.run(MinecraftServer.java:427)
    2013-02-25 20:04:16 [SEVERE]    at net.minecraft.server.v1_4_R1.ThreadServerApplication.run(SourceFile:849)
    2013-02-25 20:04:16 [SEVERE] Caused by: java.lang.IndexOutOfBoundsException: Index: 34, Size: 34
    2013-02-25 20:04:16 [SEVERE]    at java.util.ArrayList.rangeCheck(ArrayList.java:604)
    2013-02-25 20:04:16 [SEVERE]    at java.util.ArrayList.remove(ArrayList.java:445)
    2013-02-25 20:04:16 [SEVERE]    at net.minecraft.server.v1_4_R1.World.tickEntities(World.java:1216)
    2013-02-25 20:04:16 [SEVERE]    at net.minecraft.server.v1_4_R1.WorldServer.tickEntities(WorldServer.java:445)
    2013-02-25 20:04:16 [SEVERE]    at net.minecraft.server.v1_4_R1.MinecraftServer.r(MinecraftServer.java:580)
    2013-02-25 20:04:16 [SEVERE]    ... 4 more
    2013-02-25 20:04:16 [SEVERE] Encountered an unexpected exception ReportedException
    net.minecraft.server.v1_4_R1.ReportedException: Exception ticking world entities
        at net.minecraft.server.v1_4_R1.MinecraftServer.r(MinecraftServer.java:584)
        at net.minecraft.server.v1_4_R1.DedicatedServer.r(DedicatedServer.java:224)
        at net.minecraft.server.v1_4_R1.MinecraftServer.q(MinecraftServer.java:494)
        at net.minecraft.server.v1_4_R1.MinecraftServer.run(MinecraftServer.java:427)
        at net.minecraft.server.v1_4_R1.ThreadServerApplication.run(SourceFile:849)
    Caused by: java.lang.IndexOutOfBoundsException: Index: 34, Size: 34
        at java.util.ArrayList.rangeCheck(ArrayList.java:604)
        at java.util.ArrayList.remove(ArrayList.java:445)
        at net.minecraft.server.v1_4_R1.World.tickEntities(World.java:1216)
        at net.minecraft.server.v1_4_R1.WorldServer.tickEntities(WorldServer.java:445)
        at net.minecraft.server.v1_4_R1.MinecraftServer.r(MinecraftServer.java:580)
        ... 4 more
    2013-02-25 20:04:16 [SEVERE] This crash report has been saved to: C:\Users\Felix\Documents\Minecraft\Server\Plugin Testserver\.\crash-reports\crash-2013-02-25_20.04.16-server.txt
    My crashreport:
    http://pastie.org/6336060

    But because there is no support for servers in offline mode (even if they only allow premium players),
    I just set my testserver to online mode and tried to reproduce the bug.

    Same error again as I thought...
    Server.log part:
    http://pastie.org/6336084

    Crashreport:
    http://pastie.org/6336151

    If you want to, I can explain more detailed how to reproduce the bug.
     
  2. Offline

    b4ck

  3. Offline

    livengoodb

    Memory: 297494768 bytes (283 MB) <--Not enough to run a server
     
  4. Offline

    black_ixx

    Last edited by a moderator: May 31, 2016
  5. Offline

    black_ixx

    bump...​
     
  6. Offline

    TnT Retired Staff

    Have you removed all your plugins and reproduced the problem? If so, have you been able to reproduce it with a new world.

    One of your plugins has done something bad causing your server to crash.
     
  7. Offline

    black_ixx

    The thing is, that the I was just able to reproduce the error with my plugin. It looks like this: A npc attacks a player with arrows. Then when the npc fires the arrow, which should kill the player, the PlayerDeathEvent is fired, but then the server crashs at the same moment. You probably need the code:
    This line allows me to let the npc shoot arrows:
    Code:
     Arrow a = ((LivingEntity) npc.getBukkitEntity()).launchProjectile(Arrow.class);
    And this code is part of the PlayerDeathEvent listener:
    Code:
                        p.teleport(p.getWorld().getSpawnLocation());
                        MainHelper.removeItems(p);
    The rest of the listener is not able to affect the player at all.

    If you want to I can record the bug and upload the video.
     
  8. Offline

    fullwall

    black_ixx - are you perhaps removing the arrow twice? Can you show us more of the code please?
     
  9. Offline

    black_ixx

    I'm not removing the arrows at all...

    Code of listener:
    Code:
                        if (!NPCArenaHelper.players.contains(p.getName())){
       
                            return false;
                        }
                        NPCArena a = plugin.getClassHandler().getNPCMainArena().getArenaByPlayer(p);
                        if (a!=null){
                            if (a.getNPCPlayer()!=null){
                                a.getNPCPlayer().remove();
                                a.setNPCPlayer(null);}
                            a.setPlayer(null);}
                        p.teleport(p.getWorld().getSpawnLocation());
                        MainHelper.removeItems(p);
                        NPCArenaHelper.players.remove(p.getName());
    
     
  10. Offline

    black_ixx

    Same crash again:
    [​IMG]

    The error only appears when the "damager"/"attacker" (npc/skeleton) attacks very fast. For example a skeleton with a machinegun or a npc who shoots very fast. It always looks the same:
    Damager attacks.
    Player is almost dead: 1/2 heart left.
    Damager continues attacking fast.
    Crash.

    Edit:

    What I think causes the crash:
    Bukkit is ticking every x time (20 ticks a sec?).
    So now the damager attacks very fast and shoots arrows to the player.
    This player gets hit by two arrows at the same tick.
    The first arrow kills the player and the other one causes the crash.
     

    Attached Files:

  11. Offline

    black_ixx

    Is this possible?:

    "What I think causes the crash:
    Bukkit is ticking every x time (20 ticks a sec?).
    So now the damager attacks very fast and shoots arrows to the player.
    This player gets hit by two arrows at the same tick.
    The first arrow kills the player and the other one causes the crash."
     
  12. Offline

    TheFluffey

    Same issue here, different circumstances.

    A really huge bug, I think it needs fixing. Just wondering, black_ixx, do you teleport across worlds on death? I do, and I was wondering if that was an issue.
     
  13. Offline

    black_ixx

    Yep I teleport them too. I'll test it now without teleport but I think it won't change anything.

    Edit:
    Tested but the server still crashs.
     
  14. Offline

    black_ixx

    I finally found out the cause of the crash. At least one of the causes. At my arena, the enemies shot arrows and got despawned at the PlayerDeathEvent (when the player was killed). The despawning of the shooter caused the crash.

    But the server still crashs sometimes. I think this is caused by an other arena (MobArena) where some skeletons have machine guns. The error message is still the same but the skeletons never get/got despawned after they killed a player. Only 20 seconds after everybody died.
     
Thread Status:
Not open for further replies.

Share This Page