Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown command console error #11752

Open
kangarko opened this issue Dec 19, 2024 · 3 comments
Open

Unknown command console error #11752

kangarko opened this issue Dec 19, 2024 · 3 comments

Comments

@kangarko
Copy link

kangarko commented Dec 19, 2024

Expected behavior

The unknown command message.

Observed/Actual behavior

[13:25:36 WARN]: Unexpected exception while parsing console command "abcd"
java.lang.NullPointerException: command
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:922) ~[guava-33.3.1-jre.jar:?]
	at com.destroystokyo.paper.exception.ServerCommandException.<init>(ServerCommandException.java:28) ~[paper-api-1.21.4-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:1040) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:1019) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at org.bukkit.craftbukkit.CraftServer.dispatchServerCommand(CraftServer.java:1000) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.server.dedicated.DedicatedServer.handleConsoleInputs(DedicatedServer.java:505) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.server.dedicated.DedicatedServer.tickConnection(DedicatedServer.java:454) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1892) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1666) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1331) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:341) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]

Steps/models to reproduce

Call some methods in Bukkit.getConsoleSender() in a plugin's onEnable(). After this, running any unknown command will print this error instead of "Unknown command message". More testing is needed as for which methods in the sender actually break this.

This started to happen in an unknown Paper update, unfortunately I don't have the time to pinpoint to the exact build.

Plugin and Datapack List

My test plugin

Paper version

This server is running Paper version 1.21.4-15-master@bb76819 (2024-12-15T09:48:21Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)

Other

No response

@electronicboy
Copy link
Member

Need some form of minimal repro

@kangarko
Copy link
Author

For some reason now I am getting this. Unfortunately I am not able to pinpoint the exact cause:

java.util.NoSuchElementException: No value present
	at java.base/java.util.Optional.orElseThrow(Optional.java:377) ~[?:?]
	at io.papermc.paper.command.brigadier.MessageComponentSerializer.message(MessageComponentSerializer.java:23) ~[paper-api-1.21.4-R0.1-SNAPSHOT.jar:1.21.4-15-bb76819]
	at io.papermc.paper.brigadier.PaperBrigadier.componentFromMessage(PaperBrigadier.java:45) ~[paper-api-1.21.4-R0.1-SNAPSHOT.jar:1.21.4-15-bb76819]
	at net.minecraft.commands.Commands.finishParsing(Commands.java:396) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.commands.Commands.performCommand(Commands.java:351) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.commands.Commands.performCommand(Commands.java:342) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.commands.Commands.performCommand(Commands.java:337) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.performUnsignedChatCommand(ServerGamePacketListenerImpl.java:2301) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$11(ServerGamePacketListenerImpl.java:2275) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:154) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1579) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:207) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:128) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1556) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1549) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:138) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.server.MinecraftServer.managedBlock(MinecraftServer.java:1500) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1510) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1346) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:341) ~[paper-1.21.4.jar:1.21.4-15-bb76819]
	at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]

@kangarko kangarko changed the title Using Bukkit#getConsoleSender() in onEnable() corrupts the server's command map Unknown command console error Dec 19, 2024
@Machine-Maker
Copy link
Member

That error doesn't seem possible. It can't find the service via java's service loader API. Is something messing with the META-INF in the server or something removing it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants