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

Could not pass event PlayerGameModeChangeEvent to Plan v2.5.1 #8

Closed
PsychoLynx opened this issue Feb 12, 2017 · 7 comments
Closed

Could not pass event PlayerGameModeChangeEvent to Plan v2.5.1 #8

PsychoLynx opened this issue Feb 12, 2017 · 7 comments
Assignees
Labels
Bug Issues that contain unintended behavior

Comments

@PsychoLynx
Copy link

Something funky happening here as I switch my gamemode!

[10:46:32] [Server thread/ERROR]: Could not pass event PlayerGameModeChangeEvent to Plan v2.5.1
org.bukkit.event.EventException
at org.bukkit.plugin.EventExecutor$1.execute(EventExecutor.java:46) ~[patched_1.11.2.jar:git-Paper-1055]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78) ~[patched_1.11.2.jar:git-Paper-1055]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[patched_1.11.2.jar:git-Paper-1055]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:517) [patched_1.11.2.jar:git-Paper-1055]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:502) [patched_1.11.2.jar:git-Paper-1055]
at org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer.setGameMode(CraftPlayer.java:890) [patched_1.11.2.jar:git-Paper-1055]
at com.onarandombox.MultiverseCore.listeners.MVPlayerListener$2.run(MVPlayerListener.java:353) [Multiverse-Core-2.5.0-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftTask.run(CraftTask.java:58) [patched_1.11.2.jar:git-Paper-1055]
at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:356) [patched_1.11.2.jar:git-Paper-1055]
at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:820) [patched_1.11.2.jar:git-Paper-1055]
at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:403) [patched_1.11.2.jar:git-Paper-1055]
at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:754) [patched_1.11.2.jar:git-Paper-1055]
at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:652) [patched_1.11.2.jar:git-Paper-1055]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_121]
Caused by: java.lang.NullPointerException
at com.djrapitops.plan.data.handlers.GamemodeTimesHandler.handleChangeEvent(GamemodeTimesHandler.java:58) ~[?:?]
at com.djrapitops.plan.data.listeners.PlanGamemodeChangeListener.onGamemodeChange(PlanGamemodeChangeListener.java:46) ~[?:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor242.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor$1.execute(EventExecutor.java:44) ~[patched_1.11.2.jar:git-Paper-1055]
... 13 more
[10:46:47] [Craft Scheduler Thread - 42/WARN]: java.lang.NullPointerException
[10:46:47] [Craft Scheduler Thread - 42/WARN]: at com.djrapitops.plan.database.databases.SQLDB.saveGMTimes(SQLDB.java:927)
[10:46:47] [Craft Scheduler Thread - 42/WARN]: at com.djrapitops.plan.database.databases.SQLDB.saveUserData(SQLDB.java:802)
[10:46:47] [Craft Scheduler Thread - 42/WARN]: at com.djrapitops.plan.data.cache.DataCacheHandler$2.run(DataCacheHandler.java:203)
[10:46:47] [Craft Scheduler Thread - 42/WARN]: at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftTask.run(CraftTask.java:58)
[10:46:47] [Craft Scheduler Thread - 42/WARN]: at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:52)
[10:46:47] [Craft Scheduler Thread - 42/WARN]: at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22)
[10:46:47] [Craft Scheduler Thread - 42/WARN]: at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[10:46:47] [Craft Scheduler Thread - 42/WARN]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[10:46:47] [Craft Scheduler Thread - 42/WARN]: at java.lang.Thread.run(Unknown Source)
[10:47:02] [Craft Scheduler Thread - 42/WARN]: [Plan] Plugin Plan v2.5.1 generated an exception while executing task 29
java.lang.NullPointerException
at com.djrapitops.plan.data.handlers.GamemodeTimesHandler.saveToCache(GamemodeTimesHandler.java:79) ~[?:?]
at com.djrapitops.plan.data.cache.DataCacheHandler.saveHandlerDataToCache(DataCacheHandler.java:249) ~[?:?]
at com.djrapitops.plan.data.cache.DataCacheHandler.lambda$saveHandlerDataToCache$0(DataCacheHandler.java:227) ~[?:?]
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) ~[?:1.8.0_121]
at java.util.Iterator.forEachRemaining(Unknown Source) ~[?:1.8.0_121]
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source) ~[?:1.8.0_121]
at java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:1.8.0_121]
at java.util.stream.ForEachOps$ForEachTask.compute(Unknown Source) ~[?:1.8.0_121]
at java.util.concurrent.CountedCompleter.exec(Unknown Source) ~[?:1.8.0_121]
at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) ~[?:1.8.0_121]
at java.util.concurrent.ForkJoinTask.doInvoke(Unknown Source) ~[?:1.8.0_121]
at java.util.concurrent.ForkJoinTask.invoke(Unknown Source) ~[?:1.8.0_121]
at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(Unknown Source) ~[?:1.8.0_121]
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(Unknown Source) ~[?:1.8.0_121]
at java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:1.8.0_121]
at java.util.stream.ReferencePipeline.forEach(Unknown Source) ~[?:1.8.0_121]
at java.util.stream.ReferencePipeline$Head.forEach(Unknown Source) ~[?:1.8.0_121]
at com.djrapitops.plan.data.cache.DataCacheHandler.saveHandlerDataToCache(DataCacheHandler.java:226) ~[?:?]
at com.djrapitops.plan.data.cache.DataCacheHandler.access$000(DataCacheHandler.java:27) ~[?:?]
at com.djrapitops.plan.data.cache.DataCacheHandler$1.run(DataCacheHandler.java:95) ~[?:?]
at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftTask.run(CraftTask.java:58) ~[patched_1.11.2.jar:git-Paper-1055]
at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:52) [patched_1.11.2.jar:git-Paper-1055]
at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) [patched_1.11.2.jar:git-Paper-1055]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_121]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_121]

@AuroraLS3 AuroraLS3 self-assigned this Feb 12, 2017
@AuroraLS3 AuroraLS3 added the Bug Issues that contain unintended behavior label Feb 12, 2017
@AuroraLS3
Copy link
Collaborator

Bug caused because gmTimes HashMap is set to null/not set, or a GameMode is not defined in the HashMap, I will be investigating the cause further.

Are there any exceptions thrown elsewhere?
Does the error pop up everytime someone changes their gamemode or just one player?
Please send me a copy of the database to further debug the issue (if you're using mysql, use /plan manage backup mysql)
Does /plan analyze throw any errors?
If this error was thrown when a specific player changed their gamemode, please try /plan inspect to see if it throws any errors.

This is extremely odd error, because this HashMap should never be null, as it is defined in the constructor.
Possible causes:

  • Something else caused a UserData-object fail to be created properly, by throwing another error
  • The gamemode that the player was in while saving was not defined, Defined Gamemodes: SURVIVAL CREATIVE ADVENTURE SPECTATOR

Spectator has the highest likelihood of being the cause, because a bug in 1.7.X was fixed by changing how it is added & something might have gone wrong.
Try changing to /gm 1, /gm 2, /gm 3 and then /gm 0 to see which commands cause the error to be thrown.

Thanks,

  • Rsl

@AuroraLS3
Copy link
Collaborator

Bug could not be reproduced on Spigot-1.11.2-R0.1-SNAPSHOT
Tests:
ran all combinations of /gm X /gm Y

Database file required for further testing.

@PsychoLynx
Copy link
Author

Hey! I will get you the required info shortly (on a train atm so kind of in an awkard spot, please bear with me).

@PsychoLynx
Copy link
Author

PsychoLynx commented Feb 12, 2017

[15:05:16] [Server thread/INFO]: [Plan] Analysis | Starting Boot Analysis..
[15:05:19] [Craft Scheduler Thread - 3/ERROR]: [Plan] Some data might be corrupted: 68abdd33-8c33-4a6b-9aa2-9f1ba3e22b70
[15:05:19] [Craft Scheduler Thread - 3/INFO]: [Plan] Analysis | Analysis Complete.
[15:05:38] [Craft Scheduler Thread - 3/INFO]: »�[0;37;22m Processing data..�[m
[15:05:43] [Craft Scheduler Thread - 3/WARN]: java.lang.NullPointerException
[15:05:43] [Craft Scheduler Thread - 3/WARN]: 	at com.djrapitops.plan.database.databases.SQLDB.saveGMTimes(SQLDB.java:927)
[15:05:43] [Craft Scheduler Thread - 3/WARN]: 	at com.djrapitops.plan.database.databases.SQLDB.saveUserData(SQLDB.java:802)
[15:05:43] [Craft Scheduler Thread - 3/WARN]: 	at main.java.com.djrapitops.plan.command.commands.manage.ManageBackupCommand$1.run(ManageBackupCommand.java:92)
[15:05:43] [Craft Scheduler Thread - 3/WARN]: 	at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftTask.run(CraftTask.java:58)
[15:05:43] [Craft Scheduler Thread - 3/WARN]: 	at org.bukkit.craftbukkit.v1_11_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:52)
[15:05:43] [Craft Scheduler Thread - 3/WARN]: 	at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22)
[15:05:43] [Craft Scheduler Thread - 3/WARN]: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[15:05:43] [Craft Scheduler Thread - 3/WARN]: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[15:05:43] [Craft Scheduler Thread - 3/WARN]: 	at java.lang.Thread.run(Unknown Source)
[15:05:44] [Craft Scheduler Thread - 3/INFO]: �[0;32;1m[Plan] All data copied successfully!�[m
[15:05:46] [Server thread/INFO]: [NPC_Destinations] A citizens save.yml has been backed up. See the {plugin}/CitizensBackups/ for the file.
[15:06:17] [Server thread/INFO]: » Fetching data to cache..�[m
[15:06:18] [Server thread/INFO]: �[0;37;1m»�[0;32;22m Player Analytics - Analysis results�[m
[15:06:18] [Server thread/INFO]: �[0;37;22m •�[0;32;22m Link: �[0;37;1mhttp://127.0.0.1:8804/bAkEd/server�[m
[15:06:18] [Server thread/INFO]: �[0;37;1m»�[m

Going to ahead and guess it's my corrupted playerfile causing the problems (as I'm running a test server with only two accs so far.

Either way, here's the DB.
http://www.filedropper.com/mysql-backup-feb-12

@AuroraLS3
Copy link
Collaborator

AuroraLS3 commented Feb 12, 2017

Alright I'll try to figure it out :)
It might be that the data got corrupted (data is missing) because of some other error while saving it.

@AuroraLS3
Copy link
Collaborator

Ah yes the gamemode data is missing.
To uncorrupt this data run the following statement in your mysql:
INSERT INTO plan_gamemodetimes (user_id, survival, creative, adventure, spectator) VALUES (3, 0, 0, 0, 0);

This will uncorrupt the data, but it does not explain why it got corrupted in the first place.
Please try to break it again after uncorrupting it to see what is causing it ;)

@PsychoLynx
Copy link
Author

PsychoLynx commented Feb 12, 2017

I'm fairly sure this was caused by me repeatedly force-closing the development server (as I'm not concerned with the world data being corrupted), but I will let you know if it rears its head again! (Will play nice with the dev server for now ;) )

Thanks for the help!

AuroraLS3 added a commit that referenced this issue Feb 15, 2017
…ugfixes

- Fixed many cases where database might try to save empty data.
(Possible fixes to causes of #13 #8)
- Fixed partially ConcurrentModificationException causes by adding
uData.setAccessing to SaveMultipleUserData
- Sped up Graph creation with functional operations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues that contain unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants