mojira.dev
MC-115237

World and/or player data gets corrupted if a server is suddenly shut down

The bug

If an integrated / multiplayer server gets forcibly or unexpectedly closed (due to a crash / PC shutdown / OS update - Windows in particular) the world data gets corrupted.

Potential corruptions / damage:

  • Unreadable region files (chunk, block, entity data)

  • Level.dat (general data about the world and player data in singleplayer)

  • Unrecoverable player data in multiplayer (resulting in complete overwrite of the files at the next start)

  • Chunk saving errors when the server tries to save the world after the corruption

 

[14:06:37] [Server thread/WARN]: Failed to load player data for VideoklipBG
[14:06:37] [Server thread/INFO]: VideoklipBG[/192.168.0.180:50321] logged in with entity id 196 at (101.5, 67.0, -117.5)
[14:06:37] [Server thread/INFO]: VideoklipBG joined the game
[14:06:54] [File IO Thread/ERROR]: Failed to save chunk
java.lang.IndexOutOfBoundsException: Index: 811, Size: 805
        at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_181]
        at java.util.ArrayList.set(Unknown Source) ~[?:1.8.0_181]
        at bnw.a(SourceFile:304) ~[server_18w31a.jar:?]
        at bnw$a.close(SourceFile:279) ~[server_18w31a.jar:?]
        at java.util.zip.DeflaterOutputStream.close(Unknown Source) ~[?:1.8.0_181]
        at java.io.FilterOutputStream.close(Unknown Source) ~[?:1.8.0_181]
        at java.io.FilterOutputStream.close(Unknown Source) ~[?:1.8.0_181]
        at bns.a(SourceFile:270) [server_18w31a.jar:?]
        at cdt.c(SourceFile:44) [server_18w31a.jar:?]
        at cdt.run(SourceFile:35) [server_18w31a.jar:?]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_181]
[14:07:25] [Server thread/INFO]: [VideoklipBG: Saved the game]
[14:07:28] [Server thread/ERROR]: Failed to save chunk
java.lang.IndexOutOfBoundsException: Index: 807, Size: 805
        at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_181]
        at java.util.ArrayList.set(Unknown Source) ~[?:1.8.0_181]
        at bnw.a(SourceFile:304) ~[server_18w31a.jar:?]
        at bnw$a.close(SourceFile:279) ~[server_18w31a.jar:?]
        at java.util.zip.DeflaterOutputStream.close(Unknown Source) ~[?:1.8.0_181]
        at java.io.FilterOutputStream.close(Unknown Source) ~[?:1.8.0_181]
        at java.io.FilterOutputStream.close(Unknown Source) ~[?:1.8.0_181]
        at bns.a(SourceFile:270) ~[server_18w31a.jar:?]
        at bns.b(SourceFile:296) ~[server_18w31a.jar:?]
        at td.c(SourceFile:235) ~[server_18w31a.jar:?]
        at te.u(SourceFile:746) ~[server_18w31a.jar:?]
        at rk.a(SourceFile:60) ~[server_18w31a.jar:?]
        at rk.a(SourceFile:39) ~[server_18w31a.jar:?]
        at rk.a(SourceFile:25) ~[server_18w31a.jar:?]
        at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:132) ~[server_18w31a.jar:?]
        at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:72) ~[server_18w31a.jar:?]
        at bv.a(SourceFile:205) ~[server_18w31a.jar:?]
        at ud.c(SourceFile:1075) ~[server_18w31a.jar:?]
        at ud.a(SourceFile:1062) ~[server_18w31a.jar:?]
        at mi.a(SourceFile:37) ~[server_18w31a.jar:?]
        at mi.a(SourceFile:9) ~[server_18w31a.jar:?]
        at iy.a(SourceFile:10) ~[server_18w31a.jar:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_181]
        at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_181]
        at k.a(SourceFile:199) [server_18w31a.jar:?]
        at net.minecraft.server.MinecraftServer.b(SourceFile:726) [server_18w31a.jar:?]
        at sp.b(SourceFile:360) [server_18w31a.jar:?]
        at net.minecraft.server.MinecraftServer.a(SourceFile:681) [server_18w31a.jar:?]
        at net.minecraft.server.MinecraftServer.run(SourceFile:584) [server_18w31a.jar:?]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_181]
[14:07:28] [Server thread/ERROR]: Failed to save chunk
java.lang.IndexOutOfBoundsException: Index: 811, Size: 805
        at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_181]
        at java.util.ArrayList.set(Unknown Source) ~[?:1.8.0_181]
        at bnw.a(SourceFile:304) ~[server_18w31a.jar:?]
        at bnw$a.close(SourceFile:279) ~[server_18w31a.jar:?]
        at java.util.zip.DeflaterOutputStream.close(Unknown Source) ~[?:1.8.0_181]
        at java.io.FilterOutputStream.close(Unknown Source) ~[?:1.8.0_181]
        at java.io.FilterOutputStream.close(Unknown Source) ~[?:1.8.0_181]
        at bns.a(SourceFile:270) ~[server_18w31a.jar:?]
        at bns.b(SourceFile:296) ~[server_18w31a.jar:?]
        at td.c(SourceFile:235) ~[server_18w31a.jar:?]
        at te.u(SourceFile:746) ~[server_18w31a.jar:?]
        at rk.a(SourceFile:60) ~[server_18w31a.jar:?]
        at rk.a(SourceFile:39) ~[server_18w31a.jar:?]
        at rk.a(SourceFile:25) ~[server_18w31a.jar:?]
        at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:132) ~[server_18w31a.jar:?]
        at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:72) ~[server_18w31a.jar:?]
        at bv.a(SourceFile:205) ~[server_18w31a.jar:?]
        at ud.c(SourceFile:1075) ~[server_18w31a.jar:?]
        at ud.a(SourceFile:1062) ~[server_18w31a.jar:?]
        at mi.a(SourceFile:37) ~[server_18w31a.jar:?]
        at mi.a(SourceFile:9) ~[server_18w31a.jar:?]
        at iy.a(SourceFile:10) ~[server_18w31a.jar:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_181]
        at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_181]
        at k.a(SourceFile:199) [server_18w31a.jar:?]
        at net.minecraft.server.MinecraftServer.b(SourceFile:726) [server_18w31a.jar:?]
        at sp.b(SourceFile:360) [server_18w31a.jar:?]
        at net.minecraft.server.MinecraftServer.a(SourceFile:681) [server_18w31a.jar:?]
        at net.minecraft.server.MinecraftServer.run(SourceFile:584) [server_18w31a.jar:?]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_181]

 

Related issues

MC-142879 World does not appear in the world selection menu MC-144003 World completely missing (possible deleted) after visual errors MC-145933 worlds get deleted after a random crash MC-148691 World no longer appearing in my World's List after some visual issues. MC-154380 Worlds in saves folder not showing up in World List MC-154464 Shulker Box disappears after logging out and logging in MC-154479 Player Data Corrupted on Server Crash MC-168323 Game crashed and world chunks shifted MC-169094 Minecraft snapshot worlds disappearing but are still in the Minecraft files. MC-170489 THE WORLD HAS BEEN DELETED MC-174355 Chunk corruption when server closed by power outage MC-174855 World deleted MC-174887 World Access Problem MC-176705 Suppression of my favourite world MC-177326 corrupted world? MC-177567 Minecraft world gets corrupted due to computer shut off MC-177628 Can't see my save MC-178133 MC-162489 Chunks are swapped MC-180695 Disappeared world MC-180978 corupption MC-181157 Game crashed went to reload and world was gone MC-181959 chunk shuffle of my single player world after pc crash MC-186789 world deleted MC-187317 Lost Electricity, now Village suddenly blown up, landscape different MC-190320 My Minecraft world has randomly disappeared MC-191774 My world froze so I exited out of it to realize later that my world was not in the menus anymore. MC-207231 My survival world is gone. MC-211230 Computer crashes, loses hardcore world after rebooting pc MC-211263 World deleted without me knowing MC-213363 every time i join my minecraft survival world the chunks have been duplicated and some are floating and missing and stuff please fix i worked so hard MC-232207 can't open singleplayer world MC-253118 Loading crash after power went out MC-253769 Shulker Boxes deleted on crash. MC-255295 Item lost after crash MC-259520 Save Corruption after Shutdown MC-264690 Shulker Boxes are being Deleted after my Game Crashes MC-267314 Can't enter the world MCL-16596 I lost my entire game.

Comments

migrated

If you close an application without giving it any time to finish what it's doing (e. g. power outage, kill via task manager), it's inevitable that things will break. In your case, it seems that Minecraft was in the middle of writing the <player>.dat file when you force closed it. The next time you started it, Minecraft detected that the file was invalid and ignored it, generating a new blank one instead.

migrated

There are ways of coding that prevent corruption of files in such manner.

migrated

@unknown Do you have any objections if I change myself to the reporter, to keep it more up to date? (I experience this every day due to windows attempting to update every time.)

migrated

[Mod] FVbico (Steven Verberne) Oh, I thought this was an old, closed issue and I haven't updated / changed anything here, beacause it was tagged as invalid? I have nothing against that, go ahead if you want to own and update this ticket.

Actually I have created it, because a long time ago some the 1.8 verisons (1.8 - 1.8.9) and behind (1.7.10 and previous) when the Server is force-closed, killed or the process is tereminaed in some way (OS crash, Machine power off due to power outage, etc.) all the files were fine, nothing corrupted, rolled-back couple seconds, everything was saved how it's supposed to be.

From 1.9 + (I think) almost all data is corrupted in some way and regenerated on the next start. (Spawn chunks, Last loaded chunks, All player data, Stats, Info about the other dimensions and structures and many more, including "level.dat")

migrated

It was resolved as invalid for a wrong reason; I reopened it when I found it.

migrated

Well, thank you for the "support" on this issue. I'm sure that isn't supposed to be like that and there's definetly some issue with the code or it's just poorly designed.

migrated

Affects all 18w snapshots as well as the current pre-release - 1.13-pre3.

migrated

Can confirm for 1.13-pre6, including the previous few pre-releases.

migrated

this happened to me a few times, but i didn't force close the window, i was just playing with phantoms and the game crashed, when i went back on, the world disappeared from the worlds list. Minecraft is very poorly and horribly coded in terms of saving data. Not too long ago, i had chunks that loaded in buildings i SAVED.

migrated

@Calvin Zachary Stasica

No, Minecraft is not horribly coded in terms of saving. It is much more efficient than many other games of its type. A crash will always revert your world by some amount, and there's no good way around it. Also, the client may purposefully revert a small amount of time to leave time before the event that caused the crash occurs again if it is a set event. The corruption is a fixable issue that will likely be resolved in the next pre-release or update, but crashes will always have consequences.

migrated

think this has happened to me twice.

migrated

Confirmed for 20w15a.

migrated

Sometimes this even reset my statistics

migrated

I am at a complete loss as what to do. Last night I was playing Minecraft on Survival Peaceful Mode when we lost our electricity. All the power went out in our town and was not restored for several hours later. Today, when I logged in Minecraft, I went to my world (still listed as usual) and started puttering around in my castle and front gardens. I went to the back to bring stuff to the local village which is in sight and everything was messed up. Holes are everywhere, the homes of the villagers and the villagers themselves are ruined or missing, red soil from the badlands suddenly showed up in my desert, blotches of the landscape is all messed up and moved around. My world is ruined. After all my hard work and time devoted to it. I don't know how to fix this. Please help!

migrated

It already happened. It cannot be fixed. I would say to backup your world daily in the future. So if anything is lost, it is just a day.

migrated

Can confirm for Minecraft 1.20

migrated

(Unassigned)

Confirmed

Platform

Important

Save Data

Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13a, Minecraft 17w13b, Minecraft 1.12.2, ..., 1.19.2, 1.19.3, 1.20, 1.20.1, 1.20.4

Retrieved