com.forgeessentials.util.events.FEModuleEvent$FEModuleServerInitEvent during Startup
d1st4nt opened this issue · 29 comments
No idea what's caused this.
[20:54:02] [Server thread/ERROR] [FML/ForgeEssentials]: Exception caught during firing event com.forgeessentials.util.events.FEModuleEvent$FEModuleServerInitEvent@557f17c:
com.google.gson.JsonSyntaxException: duplicate key: (4f581d9e-f221-42d9-a25c-81359e44d8fb|[PR_FAKE])
at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:190) ~[MapTypeAdapterFactory$Adapter.class:?]
at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:145) ~[MapTypeAdapterFactory$Adapter.class:?]
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:93) ~[ReflectiveTypeAdapterFactory$1.class:?]
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:172) ~[ReflectiveTypeAdapterFactory$Adapter.class:?]
at com.google.gson.Gson.fromJson(Gson.java:803) ~[Gson.class:?]
at com.google.gson.Gson.fromJson(Gson.java:741) ~[Gson.class:?]
at com.forgeessentials.permissions.persistence.SingleFileProvider.load(SingleFileProvider.java:35) ~[SingleFileProvider.class:?]
at com.forgeessentials.permissions.core.ZonedPermissionHelper.load(ZonedPermissionHelper.java:165) ~[ZonedPermissionHelper.class:?]
at com.forgeessentials.permissions.ModulePermissions.serverStarting(ModulePermissions.java:130) ~[ModulePermissions.class:?]
at cpw.mods.fml.common.eventhandler.ASMEventHandler_397_ModulePermissions_serverStarting_FEModuleServerInitEvent.invoke(.dynamic) ~[?:?]
at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54) ~[ASMEventHandler.class:?]
at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140) [EventBus.class:?]
at com.forgeessentials.core.ForgeEssentials.serverStarting(ForgeEssentials.java:314) [ForgeEssentials.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_73]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_73]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_73]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_73]
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532) [FMLModContainer.class:?]
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_73]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_73]
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) [guava-17.0.jar:?]
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) [guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) [guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) [guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:275) [guava-17.0.jar:?]
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) [LoadController.class:?]
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190) [LoadController.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_73]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_73]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_73]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_73]
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) [guava-17.0.jar:?]
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) [guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) [guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) [guava-17.0.jar:?]
at com.google.common.eventbus.EventBus.post(EventBus.java:275) [guava-17.0.jar:?]
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119) [LoadController.class:?]
at cpw.mods.fml.common.Loader.serverStarting(Loader.java:789) [Loader.class:?]
at cpw.mods.fml.common.FMLCommonHandler.handleServerStarting(FMLCommonHandler.java:278) [FMLCommonHandler.class:?]
at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:277) [lt.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:387) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685) [li.class:?]
I am getting the a similar error. I have determined it is caused when you add 2 players that has never logged into a server to a group. The player is registered as for example
"(Player1UUID|null)": {
"fe.internal.player.groups": "NPC",
"fe.internal.player.known": "true"
},
"(Player2UUID|null)": {
"fe.internal.player.groups": "NPC",
"fe.internal.player.known": "true"
}
This somehow causes a duplicate key due to both players being named 'null'
To fix this crash go into the config file and remove duplicate keys.
What file do I need to go into to fix this? And what do I do to "remove duplicate keys"?
I figured it out. It was a duplicate character entry in FEData/permissions.json. I simply removed one of the entries, and my world worked fine again :-) Thank you!
For example Player1UUID|null is counted as duplicate to Player2UUID|null due to them both having a null name.
So for best practices delete any item with a null in the second part of the name. (after the | character)
It is perfectly safe for the uuid to be null, just not the player name.
This is still an issue, the above thing was simply a work around. UUID1|null and UUID2|null should not be considered duplicate even though the name on both of them is null. This adds a level of difficulty for syncing ranks across multiple servers since while null|Name1 and null|Name2 are not duplicate, names are not unique and can change, so you run the risk of a player never logging into a server, they change their name, someone else gets their old name, and logs in and receives their rank.
this is still an issue
A potential fix would be to use mojangs api
http://wiki.vg/Mojang_API
To resolve the name of a player when they are added to the permission file and populate this name for the uuid.
Also, this could be used for other things that need to resolve a player who has never joined.
Such as
#2074
We are having this issue on our server too, except with npcs.
We've had the error list both doggy style dogs and custom npcs.
[00:29:08] [Server thread/ERROR] [FML/]: Caught exception from ForgeEssentials
com.google.gson.JsonSyntaxException: duplicate key: (ddae859b-443d-4dcc-9ded-2d9165668c10|Lucy)
at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:190) ~[MapTypeAdapterFactory$Adapter.class:?]
This is in the process of being fixed. (Currently, I have fixed it but have yet to PR cause I have a few more things to add before I PR).
For now a workaround is to edit the permissions.json file and remove the duplicate values.
Also, if you have too players with the same uuid but different names, they can't be fixed in this issue.
That is a mod problem.
Please note the current fix I have won't fix your error because that is a mod bug and not a FE bug. However, I am adding an additional fix to prevent this error from happening during normal FE operations. It won't remove existing duplicate values but will prevent future duplicate values from being entered in this file. It will also throw a nasty warning because the type of duplicates you are getting are due to another mob not setting up their fake player entities right. However, if you add a duplicate value to the permissions.json file, the server will still crash because it is designed to stop if duplicate values are detected in permissions to prevent other errors from occurring that might depend on one or the other duplicate value.
So you will have to manually remove those values from the permissions.json file, but the future fix will prevent it from happening again.
Can you give me some info about how the mods are set up to trigger this. I have tried to do some testing and am unable to find a reason why the uuid/name would be duplicated. Can you post the permission.json file showing both duplications?
I know this is happening cause I have gotten the same crash, but I can't find a reason why it is happening.
a value is considered duplicate when either the uuid or the name equals another one.
Project Red generates a new uuid each time the server restarts for it's fake player resulting in that causing crashes.
We don't have Project Red in the modpack and we have renamed the NPCs in the world with unique names. Are you suggesting we should try Project Red?
We deleted all the old permissions files before learning about editing it from this thread.
we'll post a copy of it when it happens again.
It appears to be random, but can happen to any mod that has friendly npcs.
Doggy style dogs have been duplicated literally in game and then caused a crash with FE permissions and Custom NPC's have caused it, despite there not being literal duplicates of the characters at that point in world, that we know about.
Whatever triggers it appears to be completely random and only happened when FE was already installed and running.
We aren't sure what causes this, despite it happening several times.
If you want, we can post a copy of our modpack.
Also, the most important thing is the uuid before the name. If they have different uuids, they are different players, but technically also the same player cause their names are the same. You can only have 1 uuid/name per player.
As for the Etherious, that is because some mods use a different uuid every single restart. (@mrtjp)
But there is really not much you can do about it, other than bug the mod owner to fix their mod. We won't be fixing the mod to allow duplicate values but the duplicate values will no longer duplicate.
But I think that has been fixed now. I am planning to do a revamp of the temp ban system (#2074) before doing my PR, but if you need the crash fix immediately, I can either make a PR now, or make a alpha release available on my fork if @olee and @luacs1998 don't mind.
We are good. I can keep editing the file until the PR is ready. :-)
Ours shows different uuid's, with the same name.
here is the file: https://files-na.curseapp.net/14eb0cff-0759-4da6-937e-3498d8c48f95/permissions.json
Got a failed authentication
The different uuid is the bug that is causing issues (but has been fixed). You are permitted to change the name, but not the uuid. The bug was the mechanism that allowed names to be changed failed to check if the new name already existed before adding it.
Oh good. :3
We had another duplicate crash, so we have a permissions.json file for you, if you still need it.
Oddly, it has 2 Natsu Dragneels, while we are quite sure there is only one in our world.
This is that phantom duplicate thing we mentioned earlier.