mojira.dev

Heege McGee

Assigned

No issues.

Reported

No issues.

Comments

You can try to repair the damage with MCedit, but the reason it happened is likely either a) your hard drive is full b) your hard drive is about to malfunction / is malfunctioning. The root cause is that minecraft wasn't able to fully write a chunk to disk; there can be many reasons why this happens.

My only hope with updating this ticket is that Mojang will make Minecraft handle IO issues in a more intelligent way, instead of adding corruption to a save that could potentially be moved to another hard drive / server once root cause is addressed.

That server is long gone, friends. However, you can replicate the issue in the following way:

1. Get yourself a linux server
2. Get the minecraft server running, connect up, do some exploring
3. Back on the linux console via SSH, fill up the disk where the minecraft data is stored. The old "dd" utility can do this easily: dd if=/dev/zero of=/same/disk/with/minecraft/dummyfile.out bs=1024 count=100
4. Increase the count size, or make more dummy files, until the disk is full.
5. Now connect to minecraft and start exploring, or making changes to the chunks that have already been generated.
6. Check the server log file. You should see minecraft generating errors as it fails to write stuff to disk.

Seems like a reasonable time to crash to prevent writing incomplete chunk data to the disk.

The fix for this bug is for Minecraft to crash when it has errors writing chunks to disk. See my earlier comment (from 2016):
https://bugs.mojang.com/browse/MC-74762?focusedCommentId=301720&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-301720

Just went through cleaning up some file corruption related to this. I was able to identify damaged files using Fenixin's Minecraft-Region-Fixer.

In our case (1.9 multiplayer survival server), the logs showed FileIO errors about writing chunks, and it was immediately apparent that our backup script had filled the disk.

So the code was at least provided with an opportunity for error, when it's unable to push the chunk to disk. I think safe behavior for now would be to simply crash the server on write error, to prevent corruption.

Our files were so bad, a player was unable to login, and I couldn't locate the damaged files effectively without some help from google and third-party python scripts. I can certainly say my preference would have been to simply lose the changes since the first IO error, rather than troublesome restoration by hand with python or mcedit.

side note for anyone else cleaning up corruption: Minecraft-Region-Fixer is old, and a little obtuse, so it wasn't able to do a chunk based repair for me. Kept crashing on the replace_chunks activities. Nevertheless, the --log= option dumped out a complete listing of chunks and the region files they were in - i simply restored the 5 afflicted files by hand.