EnderContainers icon indicating copy to clipboard operation
EnderContainers copied to clipboard

Issue opening chests after time w/ MySQL

Open CraftingMagic-Skyy opened this issue 4 years ago • 4 comments
trafficstars

Versions EnderContainers version: 2.2.2 Platform version: paper-1.12.2

Describe the bug After some time idle, the enderchests do not seem to want to be opened when clicking enderchests

To Reproduce

  1. Start Server
  2. Wait 30(ish) minutes
  3. Try opening EnderChest either command or by chest click

Expected behavior Opens GUI

Screenshots N/A

Additional context

Using MySQL

From Log:

[21:27:55] [Craft Scheduler Thread - 383/WARN]: [EnderContainers] Plugin EnderContainers v2.2.2 generated an exception while executing task 1425886 java.lang.NullPointerException: null at fr.utarwyn.endercontainers.storage.player.PlayerSQLData.getEnderchestContents(PlayerSQLData.java:77) ~[?:?] at fr.utarwyn.endercontainers.enderchest.EnderChest.getContents(EnderChest.java:115) ~[?:?] at fr.utarwyn.endercontainers.inventory.EnderChestInventory.prepare(EnderChestInventory.java:53) ~[?:?] at fr.utarwyn.endercontainers.inventory.AbstractInventoryHolder.reloadInventory(AbstractInventoryHolder.java:132) ~[?:?] at fr.utarwyn.endercontainers.inventory.EnderChestInventory.(EnderChestInventory.java:45) ~[?:?] at fr.utarwyn.endercontainers.enderchest.EnderChest.(EnderChest.java:49) ~[?:?] at fr.utarwyn.endercontainers.enderchest.VanillaEnderChest.(VanillaEnderChest.java:35) ~[?:?] at fr.utarwyn.endercontainers.enderchest.context.PlayerContext.createEnderchest(PlayerContext.java:205) ~[?:?] at java.util.stream.IntPipeline$4$1.accept(IntPipeline.java:250) ~[?:1.8.0_292] at java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:110) ~[?:1.8.0_292] at java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:693) ~[?:1.8.0_292] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_292] at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_292] at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_292] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_292] at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) ~[?:1.8.0_292] at fr.utarwyn.endercontainers.enderchest.context.PlayerContext.loadEnderchests(PlayerContext.java:122) ~[?:?] at fr.utarwyn.endercontainers.enderchest.context.LoadTask.run(LoadTask.java:63) ~[?:?] at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftTask.run(CraftTask.java:64) ~[patched_1.12.2.jar:git-Paper-"77cce8236"] at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:52) ~[patched_1.12.2.jar:git-Paper-"77cce8236"] at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.12.2.jar:git-Paper-"77cce8236"] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_292] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_292] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_292]

CraftingMagic-Skyy avatar Nov 10 '21 21:11 CraftingMagic-Skyy

@utarwyn

CraftingMagic-Skyy avatar Nov 12 '21 21:11 CraftingMagic-Skyy

Hello @CraftingMagic-Skyy, sorry for the response delay.. It seems to be a save problem with the vanilla enderchest (because the stack mentions VanillaEnderChest file). I have an idea on how to reproduce the bug and fix it. I'll keep you informed!

Sorry for the inconvenience, Regards

utarwyn avatar Nov 16 '21 17:11 utarwyn

Just commenting to see if any updates

CraftingMagic-Skyy avatar Nov 23 '21 21:11 CraftingMagic-Skyy

I'm trying to reproduce the error on my local server but unfortunately without success.. I don't know why waiting an amount of time can cause a problem like this (this stacktrace means that player data are not loaded anymore).

Can I ask you few questions about your configuration to help me reproducing the bug?

  • What is the value of config useVanillaEnderchest?
  • Does the player has already opened one enderchest before waiting this amount of time?
  • Your database already stores some enderchest data for that player?

I'm waiting for your feedback, thank you for your time! I'm really sorry, problems like this are often complicated to reproduce and fix.


I have discovered another bug last time, the one I notice in in my last comment. When using vanilla enderchest, it also tries to load it from database but that does not make sense, so I will fix this.

utarwyn avatar Dec 05 '21 15:12 utarwyn