ToberoCat / ImprovedFactions

Factions plugin for minecraft
GNU General Public License v3.0
14 stars 11 forks source link

[Bug] No transaction in context when running `/f wilderness` #144

Closed Josh65-2201 closed 4 months ago

Josh65-2201 commented 6 months ago

Describe the bug

It worked when I did the update but after a restart it started this error

Error log from console

[16:55:15 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'f' in plugin ImprovedFactions v2.1.3
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchCommand(CraftServer.java:987) ~[paper-1.20.1.jar:git-Paper-196]
        at org.bukkit.craftbukkit.v1_20_R1.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64) ~[paper-1.20.1.jar:git-Paper-196]
        at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:265) ~[paper-1.20.1.jar:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:324) ~[?:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:308) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:2354) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$21(ServerGamePacketListenerImpl.java:2314) ~[?:?]
        at net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:59) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.20.1.jar:git-Paper-196]
        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:1338) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:197) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1315) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1308) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1286) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1174) ~[paper-1.20.1.jar:git-Paper-196]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.20.1.jar:git-Paper-196]
        at java.lang.Thread.run(Unknown Source) ~[?:?]
Caused by: java.lang.IllegalStateException: No transaction in context.
        at org.jetbrains.exposed.sql.transactions.TransactionManager$Companion.current(TransactionApi.kt:229) ~[ImprovedFactions-2.1.3.jar:?]
        at org.jetbrains.exposed.dao.EntityClass.warmCache(EntityClass.kt:49) ~[ImprovedFactions-2.1.3.jar:?]
        at org.jetbrains.exposed.dao.EntityClass.find(EntityClass.kt:285) ~[ImprovedFactions-2.1.3.jar:?]
        at org.jetbrains.exposed.dao.EntityClass.find(EntityClass.kt:296) ~[ImprovedFactions-2.1.3.jar:?]
        at io.github.toberocat.improvedfactions.utils.options.limit.PlayerUsageLimits.getUsageLimit(PlayerUsageLimits.kt:12) ~[ImprovedFactions-2.1.3.jar:?]
        at io.github.toberocat.improvedfactions.modules.wilderness.commands.WildernessCommand.cancelCommand(WildernessCommand.kt:80) ~[ImprovedFactions-2.1.3.jar:?]
        at io.github.toberocat.improvedfactions.modules.wilderness.commands.WildernessCommand.handle(WildernessCommand.kt:46) ~[ImprovedFactions-2.1.3.jar:?]
        at io.github.toberocat.improvedfactions.toberocore.command.PlayerSubCommand.handleCommand(PlayerSubCommand.java:29) ~[ImprovedFactions-2.1.3.jar:?]
        at io.github.toberocat.improvedfactions.toberocore.command.SubCommand.handleWithOptions(SubCommand.java:95) ~[ImprovedFactions-2.1.3.jar:?]
        at io.github.toberocat.improvedfactions.toberocore.command.SubCommand.routeCall(SubCommand.java:75) ~[ImprovedFactions-2.1.3.jar:?]
        at io.github.toberocat.improvedfactions.toberocore.command.CommandExecutor.onCommand(CommandExecutor.java:52) ~[ImprovedFactions-2.1.3.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        ... 23 more

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Version (please complete the following information):

ToberoCat commented 6 months ago

Oh, this is a stupid issue. It's coming from the command usage limiting code, where I forgot to put a transaction

ToberoCat commented 6 months ago

Is going to be fixed in the next build

Josh65-2201 commented 5 months ago

Seems to have broke again in 2.1.5 error.txt

ToberoCat commented 5 months ago

I've fixed it again, will leave this open in case it doesn't get fixed

Josh65-2201 commented 5 months ago

Tried with 2.2 still has the same error

ToberoCat commented 4 months ago

Fixed it.