1.12.2 Malformed JSONs
CJenkins93 opened this issue ยท 1 comments
Version: BetterQuesting-3.5.300
I own a server on the latest release of Enigmatica 2: Expert and I have frequent power outages.
I started backing up the quest data after sudden closes of the server just to see if the 'keep a backup' advice even works. The day has finally come and I can safely say it doesn't unfortunately. Like clockwork, I had a power outage last night. I even successfully saved the world just seconds before the power went out.
Looking at the JSONs that the mod claims are malformed I can see where there was text is now just a bunch of unknown characters. It looks empty but it isn't. Throwing it in JSON parsers revealed this.
The files:
QuestBackup.zip
I'm lucky that a server backup had run only 10 or so minutes before (they run every 2 hours, so VERY lucky)
Please if there's a way to prevent this JSON thing from happening it'd be nice to know it because losing quest progress every couple of days is really wearing on the last nerve of everyone in the server.
BQ only internally runs backups during updates or format changes. During every other file read/write process there are several checks in place in an attempt to ensure the files save intact and malformed files are set aside if they cannot be read. It appears however that this is such a catastrophic failure that the data in those files is unrecoverable. I could try adding even more fail safes to the ever growing list but I can't guarantee it will prevent something as serious as this. To be perfectly honest, usually it's left up to server operators to implement and test their backup solutions considering there is much more than just BQ's data at risk.
PS: If you're running this as a professional server, I'd highly consider getting a UPS. Even a small one to give enough time to perform a safe shutdown would suffice.