JorelAli / CommandAPI

A Bukkit/Spigot API for the command UI introduced in Minecraft 1.13

Home Page:https://commandapi.jorel.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CommandAPI Failing to Load on Paper

InTheRiches opened this issue · comments

CommandAPI version

9.3.0

Minecraft version

1.20.4

Are you shading the CommandAPI?

Yes

What I did

I installed CommandAPI and tried to register some basic commands through the API.

What actually happened

I got this error upon loading up the server.

[22:29:49 ERROR]: Caught previously unhandled exception :
[22:29:49 ERROR]: Paper Async Command Builder Thread Pool - 0
java.lang.IllegalStateException: zip file closed
        at java.util.zip.ZipFile.ensureOpen(ZipFile.java:831) ~[?:?]
        at java.util.zip.ZipFile.getEntry(ZipFile.java:330) ~[?:?]
        at java.util.jar.JarFile.getEntry(JarFile.java:518) ~[?:?]
        at java.util.jar.JarFile.getJarEntry(JarFile.java:473) ~[?:?]
        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:587) ~[?:?]
        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:520) ~[?:?]
        at dev.jorel.commandapi.CommandAPIBukkit.wrapCommandSender(CommandAPIBukkit.java:410) ~[RPGProject.jar:?]
        at dev.jorel.commandapi.nms.NMS_Common.getCommandSenderFromCommandSource(NMS_Common.java:380) ~[RPGProject.jar:?]
        at dev.jorel.commandapi.nms.NMS_Common.getCommandSenderFromCommandSource(NMS_Common.java:94) ~[RPGProject.jar:?]
        at dev.jorel.commandapi.CommandAPIHandler.lambda$generatePermissions$1(CommandAPIHandler.java:362) ~[RPGProject.jar:?]
        at com.mojang.brigadier.tree.CommandNode.canUse(CommandNode.java:79) ~[paper-1.20.4.jar:git-Paper-385]
        at net.minecraft.commands.Commands.fillUsableCommands(Commands.java:536) ~[?:?]
        at net.minecraft.commands.Commands.sendAsync(Commands.java:488) ~[?:?]
        at net.minecraft.commands.Commands.lambda$sendCommands$6(Commands.java:467) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

I am currently running paper, and this appears to be a compatibility issue between CommandAPI and Paper.

What should have happened

The commands should have been properly registered and there should not have been an error.

Server logs and CommandAPI config

No response

Other

No response

Are you able to provide the full server log using a site like https://paste.gg/? Just running a Paper server while registering commands doesn't have anything coming up for me. The stack trace indicates that Java failed to load the BukkitPlayer class when running this line in the CommandAPI, which seems odd without any context.

From the stack trace, it looks like the server is responding to a player joining. The code that was being run sends a packet that tells a player which commands are available for them to use. So, it seems that the steps needed to reproduce this error include a player joining the server. Do you have more specific steps for making this error happen?

Do you have any other plugins on the server?

I already talked to Jorel about this, he has the full data. Just put this here as a reminder :)

Yes, we did discuss this briefly, over in Discord here. Turns out, I was confusing this issue with #494, and they're not remotely related to one another.

Let's start from the beginning @InTheRiches, with a bit more info. As @willkroboth mentioned above, would it be possible to acquire the full server log (as opposed to just this section of the log with the error message)? A full server log may help us diagnose the issue further, because so far we've been unable to reproduce this issue in any of our test environments against any other versions of Paper, and this issue hasn't been reported by other Paper users (so it's likely something weird going on with your setup?).