Minepacks

Minepacks

2M Downloads

Error when the plugin shuts down with unsaved backpacks

GeorgH93 opened this issue ยท 2 comments

commented

Information

Environment information
Any SQL based database backend

Server/crash log

[11:23:44 ERROR]: Error occurred while disabling Minepacks v2.0.7-Release (Is it up to date?)
org.bukkit.plugin.IllegalPluginAccessException: Plugin attempted to register task while disabled
at org.bukkit.craftbukkit.v1_14_R1.scheduler.CraftScheduler.validate(CraftScheduler.java:518) ~[patched_1.14.3.jar:git-Paper-124]
at org.bukkit.craftbukkit.v1_14_R1.scheduler.CraftScheduler.runTaskTimerAsynchronously(CraftScheduler.java:221) ~[patched_1.14.3.jar:git-Paper-124]
at org.bukkit.craftbukkit.v1_14_R1.scheduler.CraftScheduler.runTaskTimerAsynchronously(CraftScheduler.java:217) ~[patched_1.14.3.jar:git-Paper-124]
at org.bukkit.craftbukkit.v1_14_R1.scheduler.CraftScheduler.runTaskLaterAsynchronously(CraftScheduler.java:168) ~[patched_1.14.3.jar:git-Paper-124]
at org.bukkit.craftbukkit.v1_14_R1.scheduler.CraftScheduler.runTaskAsynchronously(CraftScheduler.java:137) ~[patched_1.14.3.jar:git-Paper-124]
at at.pcgamingfreaks.MinepacksStandalone.Bukkit.Database.SQL.saveBackpack(SQL.java:303) ~[?:?]
at at.pcgamingfreaks.MinepacksStandalone.Bukkit.Backpack.save(Backpack.java:271) ~[?:?]
at at.pcgamingfreaks.MinepacksStandalone.Bukkit.Backpack.closeAll(Backpack.java:193) ~[?:?]
at at.pcgamingfreaks.MinepacksStandalone.Bukkit.Database.Database.lambda$close$0(Database.java:80) ~[?:?]
at java.util.concurrent.ConcurrentHashMap.forEach(Unknown Source) ~[?:1.8.0_211]
at at.pcgamingfreaks.MinepacksStandalone.Bukkit.Database.Database.close(Database.java:80) ~[?:?]
at at.pcgamingfreaks.MinepacksStandalone.Bukkit.Database.SQL.close(SQL.java:112) ~[?:?]
at at.pcgamingfreaks.MinepacksStandalone.Bukkit.Minepacks.unload(Minepacks.java:219) ~[?:?]
at at.pcgamingfreaks.MinepacksStandalone.Bukkit.Minepacks.onDisable(Minepacks.java:159) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:265) ~[patched_1.14.3.jar:git-Paper-124]
at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:373) ~[patched_1.14.3.jar:git-Paper-124]
at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:452) ~[patched_1.14.3.jar:git-Paper-124]
at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:438) ~[patched_1.14.3.jar:git-Paper-124]
at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:431) ~[patched_1.14.3.jar:git-Paper-124]
at org.bukkit.craftbukkit.v1_14_R1.CraftServer.disablePlugins(CraftServer.java:401) ~[patched_1.14.3.jar:git-Paper-124]
at net.minecraft.server.v1_14_R1.MinecraftServer.stop(MinecraftServer.java:717) ~[patched_1.14.3.jar:git-Paper-124]
at net.minecraft.server.v1_14_R1.DedicatedServer.stop(DedicatedServer.java:737) ~[patched_1.14.3.jar:git-Paper-124]
at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:949) ~[patched_1.14.3.jar:git-Paper-124]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_211] 

Details

Description
The SQL based database options save the data async to the database. It should be ensured that all save operations have been executed before closing the database and disabling the plugin.

Steps to reproduce

  1. Open backpack
  2. Add/Move/Remove item
  3. Stop server from console

chance to cause the error is increased when more players have an open backpack and the amount of database connections is reduced.

commented

@GeorgH93 You have to run the save task synchronously on shutdown

commented

@GeorgH93 You have to run the save task synchronously on shutdown

I know, I just haven't had the time to do it so far.