Shopkeepers

Shopkeepers

2M Downloads

Unable to run in version 1.20.2

Sapherises opened this issue ยท 4 comments

commented

Preliminaries:

  • Shopkeepers version: 2.17.3
  • Spigot version: 1.20.2

  • I have checked that my issue/question does not get answered by:
  • I have checked all open and closed issues, but none seems to fit my issue/question.

Reproduction on a fresh and up-to-date Spigot server:

Unable to run in version 1.20.2, the following error is reported

The issue:

[11:19:32] [Server thread/ERROR]: [Shopkeepers] Failed to load the save file! Note: Server downgrades or manually editing the save file are not supported!
com.nisovin.shopkeepers.util.data.persistence.InvalidDataFormatException: Failed to load data as Bukkit config!
at com.nisovin.shopkeepers.util.data.persistence.bukkit.BukkitConfigDataStore.loadFromString(BukkitConfigDataStore.java:63) ~[Shopkeepers-2.17.3-SNAPSHOT.jar:?]
at com.nisovin.shopkeepers.util.data.persistence.DataStoreBase.load(DataStoreBase.java:58) ~[Shopkeepers-2.17.3-SNAPSHOT.jar:?]
at com.nisovin.shopkeepers.storage.SKShopkeeperStorage.doReload(SKShopkeeperStorage.java:456) ~[Shopkeepers-2.17.3-SNAPSHOT.jar:?]
at com.nisovin.shopkeepers.storage.SKShopkeeperStorage.reload(SKShopkeeperStorage.java:408) ~[Shopkeepers-2.17.3-SNAPSHOT.jar:?]
at com.nisovin.shopkeepers.SKShopkeepersPlugin.onEnable(SKShopkeepersPlugin.java:409) ~[Shopkeepers-2.17.3-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[paper-1.20.2.jar:git-Paper-203]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[paper-1.20.2.jar:git-Paper-203]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R2.CraftServer.enablePlugin(CraftServer.java:644) ~[paper-1.20.2.jar:git-Paper-203]
at org.bukkit.craftbukkit.v1_20_R2.CraftServer.enablePlugins(CraftServer.java:555) ~[paper-1.20.2.jar:git-Paper-203]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:627) ~[paper-1.20.2.jar:git-Paper-203]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:424) ~[paper-1.20.2.jar:git-Paper-203]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:308) ~[paper-1.20.2.jar:git-Paper-203]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1086) ~[paper-1.20.2.jar:git-Paper-203]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.20.2.jar:git-Paper-203]
at java.lang.Thread.run(Thread.java:1589) ~[?:?]
Caused by: org.bukkit.configuration.InvalidConfigurationException: Could not call method 'public static com.destroystokyo.paper.profile.CraftPlayerProfile com.destroystokyo.paper.profile.CraftPlayerProfile.deserialize(java.util.Map)' of class com.destroystokyo.paper.profile.CraftPlayerProfile for deserialization
at com.nisovin.shopkeepers.util.bukkit.ConfigUtils.loadConfigSafely(ConfigUtils.java:247) ~[Shopkeepers-2.17.3-SNAPSHOT.jar:?]
at com.nisovin.shopkeepers.util.data.persistence.bukkit.BukkitConfigDataStore.loadFromString(BukkitConfigDataStore.java:61) ~[Shopkeepers-2.17.3-SNAPSHOT.jar:?]
... 16 more
Caused by: java.lang.NullPointerException: Profile name must not be null
at java.util.Objects.requireNonNull(Objects.java:259) ~[?:?]
at com.mojang.authlib.GameProfile.(GameProfile.java:31) ~[authlib-5.0.47.jar:?]
at com.destroystokyo.paper.profile.CraftPlayerProfile.(CraftPlayerProfile.java:39) ~[paper-1.20.2.jar:git-Paper-203]
at com.destroystokyo.paper.profile.CraftPlayerProfile.deserialize(CraftPlayerProfile.java:312) ~[paper-1.20.2.jar:git-Paper-203]
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:578) ~[?:?]
at org.bukkit.configuration.serialization.ConfigurationSerialization.deserializeViaMethod(ConfigurationSerialization.java:85) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.serialization.ConfigurationSerialization.deserialize(ConfigurationSerialization.java:127) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.serialization.ConfigurationSerialization.deserializeObject(ConfigurationSerialization.java:207) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:58) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:264) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:247) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping2ndStep(BaseConstructor.java:576) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.SafeConstructor.constructMapping2ndStep(SafeConstructor.java:210) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping(BaseConstructor.java:552) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlMap.construct(SafeConstructor.java:597) ~[snakeyaml-2.2.jar:?]
at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:49) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:264) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:247) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping2ndStep(BaseConstructor.java:576) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.SafeConstructor.constructMapping2ndStep(SafeConstructor.java:210) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping(BaseConstructor.java:552) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlMap.construct(SafeConstructor.java:597) ~[snakeyaml-2.2.jar:?]
at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:49) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:264) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:247) ~[snakeyaml-2.2.jar:?]
at org.bukkit.configuration.file.YamlConstructor.construct(YamlConstructor.java:37) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.file.YamlConfiguration.fromNodeTree(YamlConfiguration.java:163) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.file.YamlConfiguration.fromNodeTree(YamlConfiguration.java:161) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.file.YamlConfiguration.fromNodeTree(YamlConfiguration.java:161) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.file.YamlConfiguration.fromNodeTree(YamlConfiguration.java:161) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:120) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at com.nisovin.shopkeepers.util.bukkit.ConfigUtils.loadConfigSafely(ConfigUtils.java:240) ~[Shopkeepers-2.17.3-SNAPSHOT.jar:?]
at com.nisovin.shopkeepers.util.data.persistence.bukkit.BukkitConfigDataStore.loadFromString(BukkitConfigDataStore.java:61) ~[Shopkeepers-2.17.3-SNAPSHOT.jar:?]
... 16 more
[11:19:32] [Server thread/ERROR]: [Shopkeepers] Detected an issue during the loading of the saved shopkeepers data! Disabling the plugin!
[11:19:32] [Server thread/INFO]: [Shopkeepers] Disabling Shopkeepers v2.17.3-SNAPSHOT+bd050560

commented

Profile name must not be null

Seems like it fails at deserializing an item with a player profile without a name (e.g. in skull items).

Please check your save.yml file for such items and attach the save data for them here.

Apparently, there have been some changes to player profiles inside the server. Maybe those changes broke compatibility with older serialized data. If that is the case, the issue needs to forwarded and solved by the server.

For this it would also be useful to know on which server version (I assume 1.20.1) and how exactly those skull items were created in the first place, so that the issue can be reproduced/demonstrated by: Creating those items on previous server version, updating to 1.20.2, observing issue.

Also, it would be useful to know if the same issue can also be reproduced on Spigot instead of Paper.
Edit: Seems like Paper is directly initializing a Minecraft profile from the deserialized data (https://github.com/PaperMC/Paper/blob/master/patches/server/0141-Basic-PlayerProfile-API.patch#L62), whereas Spigot specifically checks and handles missing profile names before creating the Minecraft profile later (https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/profile/CraftPlayerProfile.java#60).

commented

I am pretty sure that this issue is specific to the Paper server and needs to be fixed there. There already seems to be a PR that might resolve this: PaperMC/Paper#9770

commented

My server started using shopkeeper in 1.19, and this error never occurred until version 1.20.2. It could be used normally in version 1.20.1. This error occurred after updating to 1.20.2 this time. I tested again on the 1.20.1 server and there were no errors, but the 1.20.2 server appeared.
There is indeed a shopkeeper who can exchange heads. Because I use excellentcrates to use player heads as reward crate items.

commented

paper merged , bug fixed