Empty/corrupted .txt files in world save/OTG dir cause the game to crash
authvin opened this issue ยท 4 comments
OTG Plugin or Mod
[Please specify if it's about Forge Mod or Spigot server Plugin placing "x" into []]
- OTG Mod for Forge
OTG Version
[Please specify the full OTG version that you are running by placing "x" into []]
- 1.12.2_v8.3
Forge or Spigot Versions
Forge 14.23.5.2847
Server/Client Log
This crash log is from flixfriedchicken in discord: https://paste.dimdev.org/ritidulisi.mccrash
It's caused by the Dimensions.txt file being empty
What other plugins are you running?
Listed in crash report, there's a lot of them. Very hard to narrow down which one caused the issue in the first place.
Description
When trying to open the list of saves in singleplayer, if one of the OTG worlds has an empty Dimensions.txt, the whole game crashes with the crash log above.
The real issue here is why this player ended up with an empty Dimensions.txt. I thought this was just a one-off random corruption of a file, but two separate players have reported this exact same issue after their game crashed in the past two weeks. One was running v9_r6, the other was running v8.3. Both had the same crash happen because their Dimensions.txt file was completely empty.
Should look at making sure the Dimensions.txt file is being written to and read from in a safe way to prevent crashes from wiping the file clean.
corrupted.zip
This is the other world that had this issue, from a week ago. It could have other issues; the Dimensions.txt being empty is the only I've found. However, trying to load it with a modified Dimensions.txt results in this crash:
crash-2020-02-25_16.20.19-server.txt
Have just closed another issue where the StructureData.txt was corrupted. This may be happening due to server crashes while writing to the files, I'm not sure if that might terminate the writing thread prematurely. Need to find a way to reproduce this, it may ofc be some other error or cascade of errors preventing OTG from saving the data correctly. Should also make sure that OTG can recover from corrupted files, even if it means data loss. Have renamed the ticket to make it more generic.
For OTG 1.12.2 v0.0_r10 I've made OTG rename existing txt/yaml files to xxx-backup before writing new files. If during loading a file is corrupted, it'll try to load the backup file. When reading/writing fails, OTG logs an error telling the user how to manually fix the problem (where possible). r10 will be available on the OTG discord a.s.a.p.
Had another person come into the discord today with a crash log that occured either when the server was idling or reloading, I couldn't get a clear answer. I asked for a full log, but there doesn't seem to be one. Either way, this crash report looks like it could be how the files get corrupted: