Players' time deleted during startup
AntZaro opened this issue ยท 24 comments
Hi,
We've been using Autorank for about 4 years now (thanks so much for all your work on this plugin!). Unfortunately, we had issues that caused us to lose the playtime of many players. We did our best to restore on an ad hoc basis over time.
More recently though, one of our admins created a script that scanned all our old Autorank backup files to recover people's total time over all of the past 4 years. His script outputted this data in the form of the total_time.yml file. We pasted this file into the Autorank folder and started the server in hope to have everyone's proper time restored.
However, when Autorank starts up, it erases basically all of the data. It will actually say in console "17,400 old entries removed!". I have tried changing plugin settings and we attempted pasting the file in multiple times (of course while the server is off). Nothing works. It erases thousands of entries each time, leaving only 20 or so out of nearly 18,000.
Is there any way to stop this behavior? We would love to give all our players their total time stat back and have the plugin store this data so that when older players return, they still have their total time as well. We already did the hard work gathering the time data; we just need the plugin to stop erasing it all. Thanks!
Yes, that's exactly it. Something like "Removed 17,500 old storage entries from the database". I can get my exact logs for you if you want.
I did go into settings and shut off the "archive old data" since these lines of text really make no dent in the storage, so no reason to erase data from players who have not played in a while. But that did not make a difference with this.
Any way to stop this from happening? It would be a HUGE help to us and finally solve our headache of players never having their times.
Did it shot the "Removed x old storage entries from the database"? What is the exact message it's outputting?
Autorank will automatically remove data from players that haven't played for a while. I have a feeling the imported data does not contain any 'age data' and hence Autorank is assuming that it is too old and deleting it.
I've got this bug aswell and noticed maybe a workaround, is using MySQL (you need to setup/configure your MySQL server) and changed the "primary storage provider" to mysql and rebooted the server. Total player times are no longer reset, in my case
@TNTUP Thanks for the heads-up. Using your hint I think I found the issue. If you use this version: http://staartvin.com:8080/job/Autorank/9/ and disable the archiving in the setting, it shouldn't be a problem anymore. Can you let me know if it worked?
@TNTUP Thanks for the heads-up. Using your hint I think I found the issue. If you use this version: http://staartvin.com:8080/job/Autorank/9/ and disable the archiving in the setting, it shouldn't be a problem anymore. Can you let me know if it worked?
Will check! I'll edit this post after testing
Edit: It does not clear with flatfile mode. I guess the MySQL option had "automatically archive old data" which the flatfile had "automatically archive old storage" right?
There was indeed a mismatch between what was in the config and what I was trying to check, and therefore it would always return 'true'.
There was indeed a mismatch between what was in the config and what I was trying to check, and therefore it would always return 'true'.
Nice!! Glad we got it solved!
@AntZaro Could you test this as well? I'll close the issue once it's fixed :)
Same issue here, now also testing the dev build you have sent @Staartvin
@sannielollie let me know how it goes!
Seems to keep working now. Only getting warns about something else, should i make a separate issue for that? https://pastebin.com/Zr4aBkGD (not using AFKManager plugin, just EssentialsX)
Also, someone had to do /ar check to get ranked up, instead of that it goes automatically. Maybe related?
Ah, i feel so stupid now. I was still running on version 1.2.1 - Sorry to bother you with my mistake!
It works great at first, but after some minutes the WARN is popping up again.
Not sure what is causing this to pop up. https://pastebin.com/V8tG1m9F
It also looks like the times of "today" "this week" and "this month" are resetting randomly aswell on that time. https://i.imgur.com/R9rneOA.png
When i do a full stop/start of my server the ar time are showing up again without issue for the first minute or so. After that, the issue is coming back again.
I spotted that, despite i am using MySQL all the data is stored in flatfile folders "data" and "playerdata" aswell.
Could it be that, because of that issue, the plugin "sees" players as AFK - thus not registering their playtime? Im using EssentialsX for AFK, using latest version of that (2.17.1.2)
Hmm, let's investigate this further. Add me on Discord (Staartvin).
Staartvin#????
You're using MySQL, but Autorank will still keep track of the local time of a player using its data and playerdata.yml files, so nothing is wrong there.
I need a #number to add u on discord, u can see it on the down-left bottom of Discord :)
Need to go in a few minutes though..
Cool, i've sent a request under "BierfietsNL" :) will talk tomorrow to narrow down the issue!
@Staartvin I will definitely test as soon as possible! It might just be a while because I'm waiting on my admin to help run our script to gather the new time data (since we last ran it back in August). He's really busy since we're approaching Christmas, but hopefully we will be able to soon.
I might try confirming for you sooner by using a test file... will let you know. Thanks for your work on this!