Linux Game save corruption - EndOfStreamException

jeff_fan

Refugee
Good afternoon everyone,
I was recently running a 7Days to die server and after its first reboot it refused to come back online. Reviewing the logs I saw a "EndOfStreamException: Attempted to read past the end of the stream" error message. Reviewing these form pages and the Steam community page it seems that there has been some success at recovering from the state but I was not able to identify the corrupted file on my own, any assistance would be greatly appreciated.

I pulled the save file off the server and onto my windows client to make it a little bit easier to debug. Here are my client logs from attempting to load the world.
 
Data in sleeper volumes in the main.ttw file is being corrupted when a count grows past 255. There is a main.ttw.bak file that you could use to replace main.ttw.

Allan and I reproduced the issue today and I have a fix for it that will be in 2.1.
"Fixed save would be corrupted if you repeatedly went near the same active scripted sleeper volume and then left the area".
 
Simply, the main.ttw is corrupted and cannot load.

You can try to fix it by going to:
C:\Users\<user name>\AppData\Roaming\7DaysToDie\Saves\<world name>\<game name>

In that folder rename main.ttw to main.ttw.old.
Rename main.ttw.bak to main.ttw.

1751503792969.png

The is also a main.ttw.ext.bak which is an even older version of the save that could also be renamed to main.ttw.

The fix coming in 2.1 will stop it from happening again, but it will not be able to load a corrupted file.
 
Last edited:
It's fantastic news that the underlying issues been resolved. Looks like our backup is corrupted as well. Its disappointing but understandable so we're starting up a new world.

Are there any actions I can take as an admin or I can ask my players to change in their behavior to prevent this issue from coming again? Is this something that is cleaned up at server restart so more frequent restarts may prevent the issue? Or is it one of those things that until this fix has been Pushed out only a truly nomadic lifestyle is safe from the gremlins of corruption It's?
 
It's fantastic news that the underlying issues been resolved. Looks like our backup is corrupted as well. Its disappointing but understandable so we're starting up a new world.

Are there any actions I can take as an admin or I can ask my players to change in their behavior to prevent this issue from coming again? Is this something that is cleaned up at server restart so more frequent restarts may prevent the issue? Or is it one of those things that until this fix has been Pushed out only a truly nomadic lifestyle is safe from the gremlins of corruption It's?
First, remember that until 2.1 drops, this can happen again.

From what faatal said, it sounds like if you go to certain POI that are using the minscript multiple times and leaving without letting the script finish spawning the zombies (and killing them in the process, presumably), then it will get corrupted. You could try to suggest players avoid going into a higher tier POI (this likely affects tier 5 more than others) and then leaving once zombies start spawning and then returning to it again a little later. But that might be hard to get people to do. And I'm not entirely sure how the bug occurs and can only go off that one sentence faatal posted, so the specifics I just wrote of how to avoid it may not be entirely correct.

If your players are regulars and willing to talk about stuff (i.e. not players who are attempting to exploit bugs), you could see if anyone remembers doing something like that... going into a higher tier POI, then leaving the area without completing it, then going back to it again (maybe in a short time, maybe in a single session, maybe between server restarts, I'm not sure). Maybe someone remembers something like that and that could give you an idea of how it happened and how to avoid it.
 
It's fantastic news that the underlying issues been resolved. Looks like our backup is corrupted as well. Its disappointing but understandable so we're starting up a new world.

Are there any actions I can take as an admin or I can ask my players to change in their behavior to prevent this issue from coming again? Is this something that is cleaned up at server restart so more frequent restarts may prevent the issue? Or is it one of those things that until this fix has been Pushed out only a truly nomadic lifestyle is safe from the gremlins of corruption It's?

In general, if you have a server, make regular (automated if possible) backups and make sure you always have a handful of backups from different times ready.
 
For the bug to happen, you have to leave and return dozens of times. I would guess people are putting bases near the higher tier POIs without clearing them. Most tier 1-3 POIs do not have scripting. The other case could be on high pop servers where many people are investigating high tier POIs and leaving without doing them or finishing them.
Post automatically merged:

You can also try deleting the main.ttw file and the game will load. From what I hear, it may do a few odd things with blocks using timers, like crafting may show a huge amount of time, but you can cancel it and start crafting the item(s) again.
 
For the bug to happen, you have to leave and return dozens of times. I would guess people are putting bases near the higher tier POIs without clearing them. Most tier 1-3 POIs do not have scripting. The other case could be on high pop servers where many people are investigating high tier POIs and leaving without doing them or finishing them.
Post automatically merged:

You can also try deleting the main.ttw file and the game will load. From what I hear, it may do a few odd things with blocks using timers, like crafting may show a huge amount of time, but you can cancel it and start crafting the item(s) again.
if you delete the main.ttw file, yes, the game will create it again, but after that there will be no zombies in the buildings! I have been struggling with this problem for 4 months, I have tried everything, only getting the file from backups helps
 
Back
Top