tebexio / Tebex-Minecraft

The new Tebex plugin for Minecraft, supporting Bukkit, Bungeecord, Velocity, Spigot, and PaperSpigot

Home Page:https://tebex.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Purpur: Issue Running Commands

itisgriff opened this issue · comments

Hello I have just updated to the latest version 2.0.0 but when I run commands like /tebex lookup or /tebex sendlink it throws an internal error has occurred and get this error for almost every command in console.

[14:25:55] [Server thread/INFO]: ItIsGriff issued server command: /tebex debug
[14:25:55] [Server thread/ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'tebex' in plugin Tebex v2.0.0
	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:168) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.craftbukkit.v1_20_R2.CraftServer.dispatchCommand(CraftServer.java:1005) ~[purpur-1.20.2.jar:git-Purpur-2095]
	at org.bukkit.craftbukkit.v1_20_R2.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64) ~[purpur-1.20.2.jar:git-Purpur-2095]
	at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:265) ~[purpur-1.20.2.jar:?]
	at net.minecraft.commands.Commands.performCommand(Commands.java:338) ~[?:?]
	at net.minecraft.commands.Commands.performCommand(Commands.java:322) ~[?:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:2279) ~[?:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$20(ServerGamePacketListenerImpl.java:2239) ~[?:?]
	at net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:59) ~[?:?]
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
	at net.minecraft.server.TickTask.run(TickTask.java:18) ~[purpur-1.20.2.jar:git-Purpur-2095]
	at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1351) ~[purpur-1.20.2.jar:git-Purpur-2095]
	at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:193) ~[purpur-1.20.2.jar:git-Purpur-2095]
	at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
	at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1328) ~[purpur-1.20.2.jar:git-Purpur-2095]
	at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1321) ~[purpur-1.20.2.jar:git-Purpur-2095]
	at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
	at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1299) ~[purpur-1.20.2.jar:git-Purpur-2095]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1187) ~[purpur-1.20.2.jar:git-Purpur-2095]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[purpur-1.20.2.jar:git-Purpur-2095]
	at java.lang.Thread.run(Thread.java:840) ~[?:?]
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
	at io.tebex.plugin.command.sub.DebugCommand.execute(DebugCommand.java:21) ~[tebex-bukkit-2.0.0.jar:?]
	at io.tebex.plugin.command.TebexCommand.onCommand(TebexCommand.java:41) ~[tebex-bukkit-2.0.0.jar:?]
	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
	... 23 more

[14:26:36] [Server thread/INFO]: ItIsGriff issued server command: /tebex sendlink ItIsGriff Captain
[14:26:36] [Server thread/ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'tebex' in plugin Tebex v2.0.0
	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:168) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.craftbukkit.v1_20_R2.CraftServer.dispatchCommand(CraftServer.java:1005) ~[purpur-1.20.2.jar:git-Purpur-2095]
	at org.bukkit.craftbukkit.v1_20_R2.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64) ~[purpur-1.20.2.jar:git-Purpur-2095]
	at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:265) ~[purpur-1.20.2.jar:?]
	at net.minecraft.commands.Commands.performCommand(Commands.java:338) ~[?:?]
	at net.minecraft.commands.Commands.performCommand(Commands.java:322) ~[?:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:2279) ~[?:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$20(ServerGamePacketListenerImpl.java:2239) ~[?:?]
	at net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:59) ~[?:?]
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
	at net.minecraft.server.TickTask.run(TickTask.java:18) ~[purpur-1.20.2.jar:git-Purpur-2095]
	at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1351) ~[purpur-1.20.2.jar:git-Purpur-2095]
	at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:193) ~[purpur-1.20.2.jar:git-Purpur-2095]
	at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
	at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1328) ~[purpur-1.20.2.jar:git-Purpur-2095]
	at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1321) ~[purpur-1.20.2.jar:git-Purpur-2095]
	at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
	at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1299) ~[purpur-1.20.2.jar:git-Purpur-2095]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1187) ~[purpur-1.20.2.jar:git-Purpur-2095]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[purpur-1.20.2.jar:git-Purpur-2095]
	at java.lang.Thread.run(Thread.java:840) ~[?:?]
Caused by: java.lang.NumberFormatException: For input string: "ItIsGriff"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:67) ~[?:?]
	at java.lang.Integer.parseInt(Integer.java:668) ~[?:?]
	at java.lang.Integer.parseInt(Integer.java:786) ~[?:?]
	at io.tebex.plugin.command.sub.SendLinkCommand.execute(SendLinkCommand.java:21) ~[tebex-bukkit-2.0.0.jar:?]
	at io.tebex.plugin.command.TebexCommand.onCommand(TebexCommand.java:41) ~[tebex-bukkit-2.0.0.jar:?]
	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?]
	... 23 more```

Adding some more errors I have getting. When running /tebex lookup ItIsGriff I get this error in game.

image

return request("/lookup/" + username) instead of return request("/user/" + username) here
according to the documentation

It appears this issue with command execution may be specific to Purpur, on initial load it seems that we think the platform is properly setup with a secret key and it's not.

This would cause the mentioned exceptions while running each command that interacts with the Tebex API.

I was able to reproduce this, and then ran /tebex secret <key> successfully to connect my store, followed by /tebex info to confirm.

After doing so I was no longer able to reproduce the issue, even after restart.

So I think what's happening here is issues setting or reading the secret key from config on initial startup. We will investigate this further.

Any updates on this?