Jannyboy11 / InvSee-plus-plus

A bukkit plugin for manipulating player inventories
Other
93 stars 16 forks source link

ReportedException: Loading NBT data #19

Closed Jannyboy11 closed 2 years ago

Jannyboy11 commented 2 years ago

Reported by Discord user: Ergail - Wyendar#1779

When opening the inventory of an offline player:

[23:31:47] [Server thread/INFO]: Ergail issued server command: /invseeplusplus:invsee Astaur
[23:31:47] [Server thread/ERROR]: [InvSee++] Error while trying to create main-inventory spectator inventory
java.util.concurrent.CompletionException: net.minecraft.ReportedException: Loading NBT data
    at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
    at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
    at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770) ~[?:?]
    at org.bukkit.craftbukkit.v1_18_R2.scheduler.CraftTask.run(CraftTask.java:101) ~[pufferfish-1.18.2.jar:git-Pufferfish-71]
    at org.bukkit.craftbukkit.v1_18_R2.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[pufferfish-1.18.2.jar:git-Pufferfish-71]
    at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[pufferfish-1.18.2.jar:git-Pufferfish-71]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: net.minecraft.ReportedException: Loading NBT data
    at net.minecraft.nbt.CompoundTag.readNamedTagData(CompoundTag.java:503) ~[?:?]
    at net.minecraft.nbt.CompoundTag$1.load(CompoundTag.java:43) ~[?:?]
    at net.minecraft.nbt.CompoundTag$1.b(CompoundTag.java:30) ~[?:?]
    at net.minecraft.nbt.CompoundTag.readNamedTagData(CompoundTag.java:497) ~[?:?]
    at net.minecraft.nbt.CompoundTag$1.load(CompoundTag.java:43) ~[?:?]
    at net.minecraft.nbt.CompoundTag$1.b(CompoundTag.java:30) ~[?:?]
    at net.minecraft.nbt.ListTag$1.load(ListTag.java:33) ~[?:?]
    at net.minecraft.nbt.ListTag$1.b(ListTag.java:16) ~[?:?]
    at net.minecraft.nbt.CompoundTag.readNamedTagData(CompoundTag.java:497) ~[?:?]
    at net.minecraft.nbt.CompoundTag$1.load(CompoundTag.java:43) ~[?:?]
    at net.minecraft.nbt.CompoundTag$1.b(CompoundTag.java:30) ~[?:?]
    at net.minecraft.nbt.NbtIo.readUnnamedTag(NbtIo.java:293) ~[?:?]
    at net.minecraft.nbt.NbtIo.read(NbtIo.java:238) ~[?:?]
    at net.minecraft.nbt.NbtIo.readCompressed(NbtIo.java:58) ~[?:?]
    at net.minecraft.nbt.NbtIo.readCompressed(NbtIo.java:33) ~[?:?]
    at com.janboerman.invsee.spigot.impl_1_18_2_R2.UUIDSearchSaveFilesStrategy.lambda$resolveUniqueId$1(UUIDSearchSaveFilesStrategy.java:53) ~[InvSee++_0.11.10.jar:?]
    at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
    ... 6 more
Caused by: java.io.EOFException
    at java.io.DataInputStream.readUnsignedShort(DataInputStream.java:346) ~[?:?]
    at java.io.DataInputStream.readUTF(DataInputStream.java:595) ~[?:?]
    at java.io.DataInputStream.readUTF(DataInputStream.java:570) ~[?:?]
    at net.minecraft.nbt.StringTag$1.load(StringTag.java:14) ~[?:?]
    at net.minecraft.nbt.StringTag$1.load(StringTag.java:13) ~[?:?]
    at net.minecraft.nbt.ListTag$1.load(ListTag.java:33) ~[?:?]
    at net.minecraft.nbt.ListTag$1.b(ListTag.java:16) ~[?:?]
    at net.minecraft.nbt.CompoundTag.readNamedTagData(CompoundTag.java:497) ~[?:?]
    at net.minecraft.nbt.CompoundTag$1.load(CompoundTag.java:43) ~[?:?]
    at net.minecraft.nbt.CompoundTag$1.b(CompoundTag.java:30) ~[?:?]
    at net.minecraft.nbt.CompoundTag.readNamedTagData(CompoundTag.java:497) ~[?:?]
    at net.minecraft.nbt.CompoundTag$1.load(CompoundTag.java:43) ~[?:?]
    at net.minecraft.nbt.CompoundTag$1.b(CompoundTag.java:30) ~[?:?]
    at net.minecraft.nbt.ListTag$1.load(ListTag.java:33) ~[?:?]
    at net.minecraft.nbt.ListTag$1.b(ListTag.java:16) ~[?:?]
    at net.minecraft.nbt.CompoundTag.readNamedTagData(CompoundTag.java:497) ~[?:?]
    at net.minecraft.nbt.CompoundTag$1.load(CompoundTag.java:43) ~[?:?]
    at net.minecraft.nbt.CompoundTag$1.b(CompoundTag.java:30) ~[?:?]
    at net.minecraft.nbt.NbtIo.readUnnamedTag(NbtIo.java:293) ~[?:?]
    at net.minecraft.nbt.NbtIo.read(NbtIo.java:238) ~[?:?]
    at net.minecraft.nbt.NbtIo.readCompressed(NbtIo.java:58) ~[?:?]
    at net.minecraft.nbt.NbtIo.readCompressed(NbtIo.java:33) ~[?:?]
    at com.janboerman.invsee.spigot.impl_1_18_2_R2.UUIDSearchSaveFilesStrategy.lambda$resolveUniqueId$1(UUIDSearchSaveFilesStrategy.java:53) ~[InvSee++_0.11.10.jar:?]
    at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
    ... 6 more
Jannyboy11 commented 2 years ago

Probably will have to read the player file from the main thread.

Jannyboy11 commented 2 years ago

Probably will have to read the player file from the main thread.

This fix is now implemented as of https://github.com/Jannyboy11/InvSee-plus-plus/commit/8dd76f920a9e16ce5f38484dec87512b5890cdd7