AuthMeReloaded icon indicating copy to clipboard operation
AuthMeReloaded copied to clipboard

Caused by: java.util.ConcurrentModificationException

Open Skjolberg opened this issue 3 years ago • 5 comments

What behaviour is observed?

Whenever my server restarts daily I get these errors, it is a login for user password change.

https://www.toptal.com/developers/hastebin/ilazutoxin.sql

Expected behaviour

Whenever my server restarts daily I get these errors, it is a login for user password change.

To Reproduce

The error is reproduced when the server is started/restarted.

Plugin list

[05:26:54 INFO]: Plugins (8): WorldEdit, ViaVersion, ConditionalEvents, ProtocolLib, WorldGuard, AuthMe, CommandWhitelist, HolographicDisplays

Server Implementation

BungeeCord

Database Implementation

MySQL

AuthMe Version

[05:27:33 INFO]: Version: AuthMeReloaded v5.6.0-SNAPSHOT (build: 2512)

Error log (if applicable)

https://www.toptal.com/developers/hastebin/ilazutoxin.sql

Configuration

https://www.toptal.com/developers/hastebin/iteduhipaq.yaml

Skjolberg avatar Jan 23 '22 04:01 Skjolberg

Unfortunately the hastebins have expired (special thanks to @Toptal for making the URLs really long and making it impossible to user the browser's back button when a hastebin isn't found) but I had a quick glance at the time and it was because of the purge task being run multiple times. It was really odd. Could you reupload the error log please?

ljacqu avatar Jan 30 '22 09:01 ljacqu

This

`[06:30:15] [Craft Scheduler Thread - 1/WARN]: Exception in thread "Craft Scheduler Thread - 1" [06:30:15] [Craft Scheduler Thread - 1/WARN]: org.apache.commons.lang.UnhandledException: Plugin AuthMe v5.6.0-SNAPSHOT-b2512 generated an exception while executing task 8 at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.util.ConcurrentModificationException at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1511) at java.base/java.util.HashMap$KeyIterator.next(HashMap.java:1534) at fr.xephi.authme.task.purge.PurgeTask.run(PurgeTask.java:93) at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:59) at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53) ... 3 more

[06:30:15] [Craft Scheduler Thread - 6/WARN]: Exception in thread "Craft Scheduler Thread - 6" [06:30:15] [Craft Scheduler Thread - 6/WARN]: org.apache.commons.lang.UnhandledException: Plugin AuthMe v5.6.0-SNAPSHOT-b2512 generated an exception while executing task 8 at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.util.ConcurrentModificationException at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1511) at java.base/java.util.HashMap$KeyIterator.next(HashMap.java:1534) at fr.xephi.authme.task.purge.PurgeTask.run(PurgeTask.java:93) at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:59) at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53) ... 3 more

[06:30:15] [Craft Scheduler Thread - 0/WARN]: Exception in thread "Craft Scheduler Thread - 0" [06:30:15] [Craft Scheduler Thread - 0/WARN]: org.apache.commons.lang.UnhandledException: Plugin AuthMe v5.6.0-SNAPSHOT-b2512 generated an exception while executing task 8 at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.util.ConcurrentModificationException at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1511) at java.base/java.util.HashMap$KeyIterator.next(HashMap.java:1534) at fr.xephi.authme.task.purge.PurgeTask.run(PurgeTask.java:93) at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:59) at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53) ... 3 more

[06:30:15] [Craft Scheduler Thread - 2/WARN]: Exception in thread "Craft Scheduler Thread - 2" [06:30:15] [Craft Scheduler Thread - 2/WARN]: org.apache.commons.lang.UnhandledException: Plugin AuthMe v5.6.0-SNAPSHOT-b2512 generated an exception while executing task 8 at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.util.ConcurrentModificationException at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1511) at java.base/java.util.HashMap$KeyIterator.next(HashMap.java:1534) at fr.xephi.authme.task.purge.PurgeTask.run(PurgeTask.java:93) at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:59) at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53) ... 3 more

[06:30:15] [Craft Scheduler Thread - 9/WARN]: Exception in thread "Craft Scheduler Thread - 9" [06:30:15] [Craft Scheduler Thread - 9/WARN]: org.apache.commons.lang.UnhandledException: Plugin AuthMe v5.6.0-SNAPSHOT-b2512 generated an exception while executing task 8 at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.util.ConcurrentModificationException at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1511) at java.base/java.util.HashMap$KeyIterator.next(HashMap.java:1534) at fr.xephi.authme.task.purge.PurgeTask.run(PurgeTask.java:93) at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:59) at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53) ... 3 more

[06:30:15] [Craft Scheduler Thread - 8/WARN]: Exception in thread "Craft Scheduler Thread - 8" [06:30:15] [Craft Scheduler Thread - 8/WARN]: org.apache.commons.lang.UnhandledException: Plugin AuthMe v5.6.0-SNAPSHOT-b2512 generated an exception while executing task 8 at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.util.ConcurrentModificationException at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1511) at java.base/java.util.HashMap$KeyIterator.next(HashMap.java:1534) at fr.xephi.authme.task.purge.PurgeTask.run(PurgeTask.java:93) at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:59) at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53) ... 3 more`

Skjolberg avatar Jan 30 '22 22:01 Skjolberg

Thanks.

Took me a while to figure out why the task was running multiple times but now I see that we schedule the purge task to run in separate steps, and it looks like the execution of an individual step takes too long on your server so it will already start the next step and this will cause the ConcurrentModificationException we see in your errors.

As a quick fix you could remove rows from your database manually in hopes that it will then be fast enough, or disable purging. For the long term we'll try to solve this, of course, and stop steps from being performed in parallel.

ljacqu avatar Jan 31 '22 16:01 ljacqu

Thanks

Skjolberg avatar Feb 13 '22 03:02 Skjolberg

Hi,

What is happening with this?

DiktatorAladeen avatar Jan 19 '23 12:01 DiktatorAladeen