EngineHub / WorldGuard

🛡️ Protect your Minecraft server and lets players claim areas
https://enginehub.org/worldguard/
Other
836 stars 545 forks source link

Error occurred while disabling WorldGuard. (java.lang.IllegalStateException: zip file closed) #2057

Closed andrewkm closed 10 months ago

andrewkm commented 10 months ago

WorldEdit Version

WorldEdit v7.3.0-SNAPSHOT+6625-64bcf66

WorldGuard Version

WorldGuard v7.1.0-SNAPSHOT+2258-0a9eb44

Platform Version

git-Paper-385 (MC: 1.20.4) (Git: 8c8862f)

Confirmations

Bug Description

Encountering error on server stop, happens 25% of the time or so. Error: https://pastebin.com/raw/cbGubEzA

[21:50:54] [Server thread/INFO]: [WorldGuard] Disabling WorldGuard v7.1.0-SNAPSHOT+2258-0a9eb44
[21:50:54] [Server thread/INFO]: [WorldGuard] Shutting down executor and cancelling any pending tasks...
[21:50:54] [Server thread/ERROR]: Error occurred while disabling WorldGuard v7.1.0-SNAPSHOT+2258-0a9eb44
java.lang.IllegalStateException: zip file closed
    at java.util.zip.ZipFile.ensureOpen(ZipFile.java:846) ~[?:?]
    at java.util.zip.ZipFile.getEntry(ZipFile.java:338) ~[?:?]
    at java.util.jar.JarFile.getEntry(JarFile.java:516) ~[?:?]
    at java.util.jar.JarFile.getJarEntry(JarFile.java:471) ~[?:?]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:209) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:593) ~[?:?]
    at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:169) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:164) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?]
    at net.goldtreeservers.worldguardextraflags.wg.handlers.GlideFlagHandler.onAbsentValue(GlideFlagHandler.java:57) ~[WorldGuardExtraFlags.jar:?]
    at net.goldtreeservers.worldguardextraflags.wg.handlers.GlideFlagHandler.onAbsentValue(GlideFlagHandler.java:18) ~[WorldGuardExtraFlags.jar:?]
    at com.sk89q.worldguard.session.handler.FlagValueChangeHandler.onClearValue(FlagValueChangeHandler.java:86) ~[worldguard-bukkit-7.1.0-SNAPSHOT-dist.jar:?]
    at com.sk89q.worldguard.session.handler.FlagValueChangeHandler.uninitialize(FlagValueChangeHandler.java:50) ~[worldguard-bukkit-7.1.0-SNAPSHOT-dist.jar:?]
    at com.sk89q.worldguard.session.Session.uninitialize(Session.java:134) ~[worldguard-bukkit-7.1.0-SNAPSHOT-dist.jar:?]
    at com.sk89q.worldguard.bukkit.session.BukkitSessionManager.shutdown(BukkitSessionManager.java:92) ~[worldguard-bukkit-7.1.0-SNAPSHOT-dist.jar:?]
    at com.sk89q.worldguard.bukkit.BukkitWorldGuardPlatform.unload(BukkitWorldGuardPlatform.java:149) ~[worldguard-bukkit-7.1.0-SNAPSHOT-dist.jar:?]
    at com.sk89q.worldguard.WorldGuard.disable(WorldGuard.java:219) ~[worldguard-bukkit-7.1.0-SNAPSHOT-dist.jar:?]
    at com.sk89q.worldguard.bukkit.WorldGuardPlugin.onDisable(WorldGuardPlugin.java:268) ~[worldguard-bukkit-7.1.0-SNAPSHOT-dist.jar:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:283) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
    at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.disablePlugin(PaperPluginInstanceManager.java:225) ~[paper-1.20.4.jar:git-Paper-385]
    at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.disablePlugins(PaperPluginInstanceManager.java:149) ~[paper-1.20.4.jar:git-Paper-385]
    at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.disablePlugins(PaperPluginManagerImpl.java:92) ~[paper-1.20.4.jar:git-Paper-385]
    at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:528) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_20_R3.CraftServer.disablePlugins(CraftServer.java:568) ~[paper-1.20.4.jar:git-Paper-385]
    at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:976) ~[paper-1.20.4.jar:git-Paper-385]
    at net.minecraft.server.dedicated.DedicatedServer.stopServer(DedicatedServer.java:821) ~[paper-1.20.4.jar:git-Paper-385]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1259) ~[paper-1.20.4.jar:git-Paper-385]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:321) ~[paper-1.20.4.jar:git-Paper-385]
    at java.lang.Thread.run(Thread.java:1583) ~[?:?]

Expected Behavior

No error while stopping server.

Reproduction Steps

  1. Stop server
  2. Observer error, 25% of the time...

Optional WorldGuard-Report

No response

Anything Else?

Unsure if related but I do notice the following in the error:

at net.goldtreeservers.worldguardextraflags.wg.handlers.GlideFlagHandler.onAbsentValue(GlideFlagHandler.java:57) ~[WorldGuardExtraFlags.jar:?]
at net.goldtreeservers.worldguardextraflags.wg.handlers.GlideFlagHandler.onAbsentValue(GlideFlagHandler.java:18) ~[WorldGuardExtraFlags.jar:?]

Unsure if this would mean the problem is with WorldGuardExtraFlags or with WorldGuard itself.

If you require any other information please let me know, thanks.

andrewkm commented 10 months ago

For others who find this issue: https://madelinemiller.dev/blog/minecraft-zip-file-closed/ (I should've searched the issues first, my bad).