Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The plugin sometimes randomly decides to corrupt it's own config. #24

Open
RealTriassic opened this issue Nov 30, 2022 · 4 comments
Open

Comments

@RealTriassic
Copy link

Bug Report 🐛

Plugin Version

1.5.6

Server Version

1.19.2

StackTrace

[08:22:29 INFO]: [HeadDrops] Enabling HeadDrops v1.5.6
[08:22:29 ERROR]: Error occurred while enabling HeadDrops v1.5.6 (Is it up to date?)
com.google.gson.JsonSyntaxException: java.io.EOFException: End of input at line 1 column 3189 path $[10].lore
        at com.google.gson.Gson.fromJson(Gson.java:973) ~[gson-2.8.9.jar:?]
        at com.google.gson.Gson.fromJson(Gson.java:901) ~[gson-2.8.9.jar:?]
        at com.github.evancolewright.headdrops.handlers.CacheHandler.loadCache(CacheHandler.java:52) ~[HeadDrops-1.5.6.jar:?]
        at com.github.evancolewright.headdrops.HeadDropsPlugin.onEnable(HeadDropsPlugin.java:14) ~[HeadDrops-1.5.6.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:371) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:548) ~[purpur-api-1.19.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:611) ~[purpur-1.19.2.jar:git-Purpur-1855]
        at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:525) ~[purpur-1.19.2.jar:git-Purpur-1855]
        at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:641) ~[purpur-1.19.2.jar:git-Purpur-1855]
        at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:427) ~[purpur-1.19.2.jar:git-Purpur-1855]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:343) ~[purpur-1.19.2.jar:git-Purpur-1855]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1116) ~[purpur-1.19.2.jar:git-Purpur-1855]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:310) ~[purpur-1.19.2.jar:git-Purpur-1855]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.io.EOFException: End of input at line 1 column 3189 path $[10].lore
        at com.google.gson.stream.JsonReader.nextNonWhitespace(JsonReader.java:1395) ~[gson-2.8.9.jar:?]
        at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:481) ~[gson-2.8.9.jar:?]
        at com.google.gson.stream.JsonReader.hasNext(JsonReader.java:413) ~[gson-2.8.9.jar:?]
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216) ~[gson-2.8.9.jar:?]
        at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41) ~[gson-2.8.9.jar:?]
        at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72) ~[gson-2.8.9.jar:?]
        at com.google.gson.Gson.fromJson(Gson.java:963) ~[gson-2.8.9.jar:?]
        ... 14 more
[08:22:29 INFO]: [HeadDrops] Disabling HeadDrops v1.5.6

Steps to Reproduce

I am not exactly sure, it happens randomly after rebooting your server. It doesn't happen all of the time. Once the bug is triggered, a config regeneration is required to fix it.

@evancolewright
Copy link
Owner

Working to completely redo this plugin. Hopefully can push that out in the next week.

@RealTriassic
Copy link
Author

Working to completely redo this plugin. Hopefully can push that out in the next week.

A hotfix for this issue would be nice

@RealTriassic
Copy link
Author

Hello, quick update. It is not the config that is being corrupted but instead headLocations.json.

Before the file corrupts itsself, it throws this error in console:

[13:51:40 ERROR]: Error occurred while disabling HeadDrops v1.5.6 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.World.getName()" because the return value of "org.bukkit.Location.getWorld()" is null
        at com.github.evancolewright.headdrops.handlers.CacheHandler$LocationAdapter.serialize(CacheHandler.java:98) ~[HeadDrops-1.5.6.jar:?]
        at com.github.evancolewright.headdrops.handlers.CacheHandler$LocationAdapter.serialize(CacheHandler.java:80) ~[HeadDrops-1.5.6.jar:?]
        at com.google.gson.internal.bind.TreeTypeAdapter.write(TreeTypeAdapter.java:88) ~[gson-2.10.jar:?]
        at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:70) ~[gson-2.10.jar:?]
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:196) ~[gson-2.10.jar:?]
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:366) ~[gson-2.10.jar:?]
        at com.google.gson.internal.bind.ObjectTypeAdapter.write(ObjectTypeAdapter.java:183) ~[gson-2.10.jar:?]
        at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:70) ~[gson-2.10.jar:?]
        at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.write(CollectionTypeAdapterFactory.java:97) ~[gson-2.10.jar:?]
        at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.write(CollectionTypeAdapterFactory.java:61) ~[gson-2.10.jar:?]
        at com.google.gson.Gson.toJson(Gson.java:825) ~[gson-2.10.jar:?]
        at com.google.gson.Gson.toJson(Gson.java:795) ~[gson-2.10.jar:?]
        at com.google.gson.Gson.toJson(Gson.java:766) ~[gson-2.10.jar:?]
        at com.github.evancolewright.headdrops.handlers.CacheHandler.saveCache(CacheHandler.java:67) ~[HeadDrops-1.5.6.jar:?]
        at com.github.evancolewright.headdrops.HeadDropsPlugin.onDisable(HeadDropsPlugin.java:21) ~[HeadDrops-1.5.6.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:266) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:403) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:587) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:564) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_19_R2.CraftServer.disablePlugins(CraftServer.java:564) ~[purpur-1.19.3.jar:git-Purpur-1915]
        at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:957) ~[purpur-1.19.3.jar:git-Purpur-1915]
        at net.minecraft.server.dedicated.DedicatedServer.stopServer(DedicatedServer.java:845) ~[purpur-1.19.3.jar:git-Purpur-1915]
        at net.minecraft.server.MinecraftServer.close(MinecraftServer.java:904) ~[purpur-1.19.3.jar:git-Purpur-1915]
        at org.spigotmc.RestartCommand.shutdownServer(RestartCommand.java:92) ~[purpur-1.19.3.jar:git-Purpur-1915]
        at org.spigotmc.RestartCommand.restart(RestartCommand.java:61) ~[purpur-1.19.3.jar:git-Purpur-1915]
        at org.spigotmc.RestartCommand.restart(RestartCommand.java:40) ~[purpur-1.19.3.jar:git-Purpur-1915]
        at org.spigotmc.RestartCommand$1.run(RestartCommand.java:31) ~[purpur-1.19.3.jar:git-Purpur-1915]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1513) ~[purpur-1.19.3.jar:git-Purpur-1915]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:488) ~[purpur-1.19.3.jar:git-Purpur-1915]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1424) ~[purpur-1.19.3.jar:git-Purpur-1915]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1194) ~[purpur-1.19.3.jar:git-Purpur-1915]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:321) ~[purpur-1.19.3.jar:git-Purpur-1915]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

@RealTriassic
Copy link
Author

The error occurs whilst stopping the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants