plan-player-analytics / Plan

Player Analytics plugin for Minecraft Server platforms - View player activity of your server with ease. :calendar:
https://www.spigotmc.org/resources/plan-player-analytics.32536/
GNU Lesser General Public License v3.0
871 stars 168 forks source link

Duplicate servers #2254

Open Thin-Troll opened 2 years ago

Thin-Troll commented 2 years ago

Describe the issue

Every day I reboot 7 servers at the same time, each of them has Plan installed, the plugins do not start when they are first turned on and there are no errors, they are simply displayed as Offline in the web part, if you restart them manually (/ plan reload), then the servers will be updated in the web part and will show statistics. Over time, the above process gives the effect of duplicate servers.

Exceptions & other logs

https://disk.yandex.ru/d/RctUPm9wAix-aA - ServerInfoFile.yml https://cdn.discordapp.com/attachments/466241867797889054/935615711496261632/unknown.png - information from mysql about all duplicates

Plugin versions

Plan 1516 paper 1.12.2 (build 1620)

Additional information

No response

AuroraLS3 commented 2 years ago

TODO: Investigate the server information storage of game servers for any inconsistencies

AuroraLS3 commented 2 years ago

Noted symptoms:

Investigation

Thin-Troll commented 2 years ago

Ladder reboot solved the problem. After I transferred more problems were not observed

AuroraLS3 commented 2 years ago

I could not figure why it happens, but I fixed some stuff and logging that could affect it. There is some multi-threading going on that could be do the odd things like reloading bringing back the old information.

Since this issue only pops up when database is busy during enable it's likely that some of the code covered for the underlying bug, executing fast enough to get the server information up to date. Anyway, if servers are registered now there is a log message to catch it so people may report more if it is a common bug.

Thin-Troll commented 2 years ago

oh damn literally 6 hours ago I deleted duplicate servers .. and I wanted to write, but here you are. any information required?

AuroraLS3 commented 2 years ago

Another person had same issue so I reopened this.

Any logs with Registering a new server in database with UUID are appreciated as that logging was added during previous attempt of figuring this out

Thin-Troll commented 2 years ago

found nothing either in the BungeeCord logs or in the local servers that were created by the duplicate. Search in Plan > Logs and in the main server logs

Requested: Registering a new server in database with UUID

AuroraLS3 commented 2 years ago

That is very odd.

Thin-Troll commented 2 years ago

Updated to 1661, servers are duplicated again, but this time there is a message Registering a new server in database with UUID

image

AuroraLS3 commented 2 years ago

Okay at it is clear from the log order that the database had not yet completely opened before it decided to register a new server.

I'll take a look when I have the time.

AuroraLS3 commented 2 years ago

Just to make sure (I can't remember if I have asked this) - did you delete /plugins/Plan/ServerInfoFile.yml when updating the plugin?

Thin-Troll commented 2 years ago

I updated the plugin and the servers were not duplicated. The file was not deleted.

Thin-Troll commented 2 years ago

Servers are duplicated again.

AuroraLS3 commented 2 years ago

Somebody got this again on discord and their ServerInfoFile.yml cleared for some reason 🤔 im im

AuroraLS3 commented 2 years ago

Ok! Now I might have figured out what is happening: Two threads try to write the server details to the file at the same time, but by accident they write in the following sequence:

AuroraLS3 commented 2 years ago

Here's a dev build of the above commit, I was unable to reproduce the issue still, but this might fix it regardless Plan-5.4-dev-build-1696.jar.zip PlanFabric-5.4-dev-build-1696.jar.zip

Thin-Troll commented 2 years ago

There were duplicates, but this time I did not find the messages Registering a new server in database with UUID

image image

Thin-Troll commented 2 years ago

using version 1696

AuroraLS3 commented 2 years ago

Did you update all servers? 🤔 Note that there's also the possibility of old version leaving behind empty ServerInfoFile.yml for the new version to duplicate one last time

Please let me know if it happens again after this incident

Thin-Troll commented 2 years ago

ok, I'll try again to remove the duplicates and see the result. image

AuroraLS3 commented 2 years ago

Here's a new build since your screenshot shows that SkyPvP has duplicated again (id 57) despite running newest build Plan-5.4-dev-build-1702.jar.zip

AuroraLS3 commented 1 year ago

Reopening due to #2768