Server crashing when creating a world after startup.

Discussion in 'Spigot Plugin Development' started by Sulphate, Jun 7, 2017.

  1. Hello,

    So I have a plugin that regenerates worlds on startup and on request. On startup, it generates them fine with no trouble. When I try to regenerate the worlds after startup, the server crashes after a while. This is the relevant bit of the log:

    Code (Text):

    [14:20:40] [Server thread/INFO]: [SurviveAndThrive] Deleting existing 'less-resources-night' world.
    [14:20:40] [Server thread/INFO]: [SurviveAndThrive] World deleted.
    [14:20:40] [Server thread/INFO]: [SurviveAndThrive] Creating 'less-resources-night' world.
    [14:20:40] [Server thread/INFO]: -------- World Settings For [less-resources-night] --------
    [14:20:40] [Server thread/INFO]: <Insert World Settings Here>
    [14:20:40] [Server thread/INFO]: Preparing start region for level 4 (Seed: -3723374418997171016)
    [14:20:41] [Server thread/INFO]: Preparing spawn area for less-resources-night, 12%
    [14:20:42] [Server thread/INFO]: Preparing spawn area for less-resources-night, 24%
    [14:20:43] [Server thread/INFO]: Preparing spawn area for less-resources-night, 40%
    [14:20:44] [Server thread/INFO]: Preparing spawn area for less-resources-night, 48%
    [14:20:45] [Server thread/INFO]: Preparing spawn area for less-resources-night, 52%
    [14:20:46] [Server thread/INFO]: Preparing spawn area for less-resources-night, 56%
    [14:20:48] [Server thread/INFO]: Preparing spawn area for less-resources-night, 61%
    [14:20:49] [Server thread/INFO]: Preparing spawn area for less-resources-night, 65%
    [14:20:50] [Server thread/INFO]: Preparing spawn area for less-resources-night, 69%
    [14:20:51] [Server thread/INFO]: Preparing spawn area for less-resources-night, 77%
    [14:20:52] [Server thread/INFO]: Preparing spawn area for less-resources-night, 81%
    [14:20:53] [Server thread/INFO]: Preparing spawn area for less-resources-night, 85%
    [14:20:54] [Server thread/INFO]: Preparing spawn area for less-resources-night, 89%
    [14:20:55] [Server thread/INFO]: Preparing spawn area for less-resources-night, 93%
    [14:20:56] [Spigot Watchdog Thread/ERROR]: The server has stopped responding!
    [14:20:56] [Spigot Watchdog Thread/ERROR]: Please report this to http://www.spigotmc.org/
    [14:20:56] [Spigot Watchdog Thread/ERROR]: Be sure to include ALL relevant console errors and Minecraft crash reports
    [14:20:56] [Spigot Watchdog Thread/ERROR]: Spigot version: git-Spigot-047f737-744e1a1 (MC: 1.10.2)
    [14:20:56] [Spigot Watchdog Thread/ERROR]: ------------------------------
    [14:20:56] [Spigot Watchdog Thread/ERROR]: Server thread dump (Look for plugins here before reporting to Spigot!):
    [14:20:56] [Spigot Watchdog Thread/ERROR]: ------------------------------
    [14:20:56] [Spigot Watchdog Thread/ERROR]: Current Thread: Server thread
    [14:20:56] [Spigot Watchdog Thread/ERROR]:     PID: 19 | Suspended: false | Native: false | State: RUNNABLE
    [14:20:56] [Spigot Watchdog Thread/ERROR]:     Stack:
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.World.E(World.java:262)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.World.isValidLocation(World.java:258)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.World.b(World.java:705)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.World.a(World.java:2289)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.World.c(World.java:2391)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.Chunk.a(Chunk.java:284)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.Chunk.b(Chunk.java:274)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.Chunk.h(Chunk.java:253)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.Chunk.z(Chunk.java:1206)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.Chunk.o(Chunk.java:1192)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.Chunk.a(Chunk.java:963)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.Chunk.loadNearby(Chunk.java:950)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.ChunkProviderServer.originalGetChunkAt(ChunkProviderServer.java:172)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:139)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:119)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:115)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         org.bukkit.craftbukkit.v1_10_R1.CraftServer.createWorld(CraftServer.java:935)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         org.bukkit.Bukkit.createWorld(Bukkit.java:468)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         org.bukkit.WorldCreator.createWorld(WorldCreator.java:261)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         me.sulphate.surviveandthrive.utils.WorldUtils.regenerateWorlds(WorldUtils.java:83)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         me.sulphate.surviveandthrive.commands.AdminCommand.runPlayerCommand(AdminCommand.java:25)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         me.sulphate.surviveandthrive.commands.PluginCommand.onCommand(PluginCommand.java:12)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         org.bukkit.craftbukkit.v1_10_R1.CraftServer.dispatchCommand(CraftServer.java:647)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.PlayerConnection.handleCommand(PlayerConnection.java:1358)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.PlayerConnection.a(PlayerConnection.java:1193)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.PacketPlayInChat.a(PacketPlayInChat.java:45)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.PacketPlayInChat.a(PacketPlayInChat.java:1)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.PlayerConnectionUtils$1.run(SourceFile:13)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.FutureTask.run(FutureTask.java:266)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.SystemUtils.a(SourceFile:45)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.MinecraftServer.D(MinecraftServer.java:732)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.DedicatedServer.D(DedicatedServer.java:400)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.MinecraftServer.C(MinecraftServer.java:668)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.java:567)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.lang.Thread.run(Thread.java:745)
    [14:20:56] [Spigot Watchdog Thread/ERROR]: ------------------------------
    [14:20:56] [Spigot Watchdog Thread/ERROR]: Entire Thread Dump:
    [14:20:56] [Spigot Watchdog Thread/ERROR]: ------------------------------
    [14:20:56] [Spigot Watchdog Thread/ERROR]: Current Thread: Ram monitor listening thread
    [14:20:56] [Spigot Watchdog Thread/ERROR]:     PID: 57 | Suspended: false | Native: true | State: RUNNABLE
    [14:20:56] [Spigot Watchdog Thread/ERROR]:     Stack:
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.net.PlainSocketImpl.socketAccept(Native Method)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.net.ServerSocket.implAccept(ServerSocket.java:545)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.net.ServerSocket.accept(ServerSocket.java:513)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         kokolihapihvi.rammonitor.TcpSocket.listen(TcpSocket.java:21)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         kokolihapihvi.rammonitor.RamMonitor$1.run(RamMonitor.java:30)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.lang.Thread.run(Thread.java:745)
    [14:20:56] [Spigot Watchdog Thread/ERROR]: ------------------------------
    [14:20:56] [Spigot Watchdog Thread/ERROR]: Current Thread: pool-18-thread-1
    [14:20:56] [Spigot Watchdog Thread/ERROR]:     PID: 55 | Suspended: false | Native: false | State: WAITING
    [14:20:56] [Spigot Watchdog Thread/ERROR]:     Stack:
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         sun.misc.Unsafe.park(Native Method)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.lang.Thread.run(Thread.java:745)
    [14:20:56] [Spigot Watchdog Thread/ERROR]: ------------------------------
    [14:20:56] [Spigot Watchdog Thread/ERROR]: Current Thread: pool-17-thread-1
    [14:20:56] [Spigot Watchdog Thread/ERROR]:     PID: 54 | Suspended: false | Native: false | State: WAITING
    [14:20:56] [Spigot Watchdog Thread/ERROR]:     Stack:
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         sun.misc.Unsafe.park(Native Method)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.lang.Thread.run(Thread.java:745)
    [14:20:56] [Spigot Watchdog Thread/ERROR]: ------------------------------
    [14:20:56] [Spigot Watchdog Thread/ERROR]: Current Thread: Chunk I/O Executor Thread-1
    [14:20:56] [Spigot Watchdog Thread/ERROR]:     PID: 53 | Suspended: false | Native: false | State: WAITING
    [14:20:56] [Spigot Watchdog Thread/ERROR]:     Stack:
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         sun.misc.Unsafe.park(Native Method)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.lang.Thread.run(Thread.java:745)
    [14:20:56] [Spigot Watchdog Thread/ERROR]: ------------------------------
    [14:20:56] [Spigot Watchdog Thread/ERROR]: Current Thread: Netty Epoll Server IO #2
    [14:20:56] [Spigot Watchdog Thread/ERROR]:     PID: 29 | Suspended: false | Native: false | State: RUNNABLE
    [14:20:56] [Spigot Watchdog Thread/ERROR]:     Stack:
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         io.netty.channel.epoll.Native.epollWait(Native Method)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         io.netty.channel.epoll.EpollEventLoop.epollWait(EpollEventLoop.java:194)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:219)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.lang.Thread.run(Thread.java:745)
    [14:20:56] [Spigot Watchdog Thread/ERROR]: ------------------------------
    [14:20:56] [Spigot Watchdog Thread/ERROR]: Current Thread: pool-9-thread-1
    [14:20:56] [Spigot Watchdog Thread/ERROR]:     PID: 46 | Suspended: false | Native: false | State: WAITING
    [14:20:56] [Spigot Watchdog Thread/ERROR]:     Stack:
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         sun.misc.Unsafe.park(Native Method)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.lang.Thread.run(Thread.java:745)
    [14:20:56] [Spigot Watchdog Thread/ERROR]: ------------------------------
    [14:20:56] [Spigot Watchdog Thread/ERROR]: Current Thread: File IO Thread
    [14:20:56] [Spigot Watchdog Thread/ERROR]:     PID: 45 | Suspended: false | Native: false | State: TIMED_WAITING
    [14:20:56] [Spigot Watchdog Thread/ERROR]:     Stack:
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.lang.Thread.sleep(Native Method)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.FileIOThread.c(SourceFile:51)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.FileIOThread.run(SourceFile:30)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.lang.Thread.run(Thread.java:745)
    [14:20:56] [Spigot Watchdog Thread/ERROR]: ------------------------------
    [14:20:56] [Spigot Watchdog Thread/ERROR]: Current Thread: Query Listener #1
    [14:20:56] [Spigot Watchdog Thread/ERROR]:     PID: 34 | Suspended: false | Native: false | State: RUNNABLE
    [14:20:56] [Spigot Watchdog Thread/ERROR]:     Thread is waiting on monitor(s):
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         Locked on:java.net.PlainDatagramSocketImpl.receive0(Native Method)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         Locked on:java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:143)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         Locked on:java.net.DatagramSocket.receive(DatagramSocket.java:812)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         Locked on:java.net.DatagramSocket.receive(DatagramSocket.java:812)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:     Stack:
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.net.PlainDatagramSocketImpl.receive0(Native Method)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:143)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.net.DatagramSocket.receive(DatagramSocket.java:812)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         net.minecraft.server.v1_10_R1.RemoteStatusListener.run(SourceFile:268)
    [14:20:56] [Spigot Watchdog Thread/ERROR]:         java.lang.Thread.run(Thread.java:745)
    [14:20:56] [Spigot Watchdog Thread/ERROR]: ------------------------------
    [14:20:56] [Spigot Watchdog Thread/ERROR]: ------------------------------
     

    No clue why it would stop responding if it's fine on startup and still has plenty of RAM available...

    Any help appreciated, thanks!

    EDIT: I had to cut out a bit of the bottom of the log in order to post it.
     
  2. Maybe a snippet of code would help. Preferably from this area...

    Code (Text):

    me.sulphate.surviveandthrive.utils.WorldUtils.regenerateWorlds(WorldUtils.java:83)
     
     
  3. sothatsit

    Patron

    Would help if you shared your code.

    Edit: Sniped.