watchdog server kill froze server because of exception
Stack trace
[17:42:30] [Paper Watchdog Thread/INFO]: Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PAPER)
[17:42:30] [Paper Watchdog Thread/INFO]: Stopping server
[17:42:30] [Paper Watchdog Thread/INFO]: Saving players
[17:42:30] [Paper Watchdog Thread/WARN]: Asynchronous Save Players! Blocking thread until it returns
java.lang.IllegalStateException: null
at io.papermc.paper.util.MCUtil.ensureMain(MCUtil.java:350) [?:1.21-DEV-0e02aa5]
at net.minecraft.server.players.PlayerList.h(PlayerList.java:1185) [?:1.21-DEV-0e02aa5]
at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:1060) [?:1.21-DEV-0e02aa5]
at net.minecraft.server.dedicated.DedicatedServer.v(DedicatedServer.java:845) [?:1.21-DEV-0e02aa5]
at net.minecraft.server.MinecraftServer.close(MinecraftServer.java:1006) [?:1.21-DEV-0e02aa5]
at org.spigotmc.WatchdogThread.run(WatchdogThread.java:231) [?:1.21-DEV-0e02aa5]
Plugin and Datapack List
not relevant
Actions to reproduce (if known)
Sleep in the main thread for over 10 seconds then paper kills the server and the exception occurs
Paper version
[13:17:25 INFO]: Checking version, please wait... [13:17:25 INFO]: This server is running Paper version 1.21-DEV-master@2288e13 (2024-07-13T21:34:15Z) (Implementing API version 1.21-R0.1-SNAPSHOT) You are running the latest version Previous version: 1.21-DEV-5a503d7 (MC: 1.21) We use the reobf version so its selfbuild, but this is 1.21-63
Other
this error occurs because the PaperWatchdogThread (which kills / stop the server) is not the main tick thread
Resolved by 1595e4afc097ad595cf10106044774170f779701
Resolved by 1595e4a
It seems that the bug is still present today https://mclo.gs/30wzd87
[12:36:35] [Server thread/INFO]: Preparing start region for dimension minecraft:overworld
--
130 | [12:45:02] [Thread-2/INFO]: Stopping server
131 | [12:45:02] [Thread-2/INFO]: [SkinsRestorer] Disabling SkinsRestorer v15.2.0
132 | [12:45:02] [Thread-2/INFO]: [WorldEdit] Disabling WorldEdit v7.3.4+6823-6263244
133 | [12:45:02] [Thread-2/INFO]: Unregistering com.sk89q.worldedit.bukkit.BukkitServerInterface from WorldEdit
134 | [12:45:02] [Thread-2/INFO]: [Veinminer] Disabling Veinminer v2.1.0
135 | [12:45:02] [Thread-2/INFO]: Saving players
136 | [12:45:02] [Thread-2/WARN]: Asynchronous Save Players! Blocking thread until it returns
137 | java.lang.IllegalStateException: null
138 | at io.papermc.paper.util.MCUtil.ensureMain(MCUtil.java:112) ~[paper-1.21.jar:1.21-99-f1f01a1]
139 | at net.minecraft.server.players.PlayerList.saveAll(PlayerList.java:1192) ~[paper-1.21.jar:1.21-99-f1f01a1]
140 | at net.minecraft.server.players.PlayerList.saveAll(PlayerList.java:1188) ~[paper-1.21.jar:1.21-99-f1f01a1]
141 | at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:1051) ~[paper-1.21.jar:1.21-99-f1f01a1]
142 | at net.minecraft.server.dedicated.DedicatedServer.stopServer(DedicatedServer.java:845) ~[paper-1.21.jar:1.21-99-f1f01a1]
143 | at net.minecraft.server.MinecraftServer.close(MinecraftServer.java:1006) ~[paper-1.21.jar:1.21-99-f1f01a1]
144 | at org.bukkit.craftbukkit.util.ServerShutdownThread.run(ServerShutdownThread.java:27) ~[paper-1.21.jar:1.21-99-f1f01a1]
145 | [12:45:13] [Aternos System/ERROR]: Server was stopped because it took too long to start. Try reducing the load to avoid this in the future.