Corrupted save file of 110+ hour game save

Place for things which are bugs but we have no idea how to solve them. Things related to hardware, libraries, strange setups, etc.
Post Reply
Leosmellsgood
Inserter
Inserter
Posts: 28
Joined: Fri Jan 16, 2015 10:35 am

Corrupted save file of 110+ hour game save

Post by Leosmellsgood » Sun Nov 19, 2017 12:48 am

Opening zip C:/Users/leosm/AppData/Roaming/Factorio/saves/Pre 16.zip failed: Bad zip file
Also says invalid or corrupt file and prompts me to delete the save. This is my biggest save and probably in the top 1% of factories out there. It has 150M iron plate produced and up to 10Gw power consumption. I dont want to abandon this save :( When I try to extract the files I get the error message "C:\Users\leosm\AppData\Roaming\Factorio\saves\Pre 16.zip: The archive is corrupt". Any help is appreciated. :|
Attachments
Pre 16.zip
(Its big)
(82.26 MiB) Downloaded 21 times

User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm

Re: Corrupted save file of 110+ hour game save

Post by impetus maximus » Sun Nov 19, 2017 9:55 am

you have auto save slots disabled?

Leosmellsgood
Inserter
Inserter
Posts: 28
Joined: Fri Jan 16, 2015 10:35 am

Re: Corrupted save file of 110+ hour game save

Post by Leosmellsgood » Mon Nov 20, 2017 6:02 am

Yes i do, last autosave was at 21 hours

Koub
Global Moderator
Global Moderator
Posts: 3751
Joined: Fri May 30, 2014 8:54 am

Re: Corrupted save file of 110+ hour game save

Post by Koub » Mon Nov 20, 2017 6:28 am

Your save file is incomplete : from byte 0x01400000 (around 20 MB) up to the end of file, it's totally blank, only '0's
Did you expérience whatever may cause a save to be incomplete (game grash during save, computer reboot, or anything ) ?
BTW : disabling autosaves may not be the smartest idea to do if you want safety.

I'll let the topic here, because even if I don't see how it could be a problem due to the game, I've seen such posts a pair of times, and I start to doubt.
Koub - Please consider English is not my native language.

Zavian
Smart Inserter
Smart Inserter
Posts: 1064
Joined: Thu Mar 02, 2017 2:57 am

Re: Corrupted save file of 110+ hour game save

Post by Zavian » Mon Nov 20, 2017 7:28 am

You might be able to restore a working version of an older save using your backups or windows previous versions,
https://www.howtogeek.com/56891/use-win ... our-files/

Oxyd
Factorio Staff
Factorio Staff
Posts: 1084
Joined: Thu May 07, 2015 8:42 am

Re: Corrupted save file of 110+ hour game save

Post by Oxyd » Mon Nov 20, 2017 5:43 pm

Koub wrote:Your save file is incomplete : from byte 0x01400000 (around 20 MB) up to the end of file, it's totally blank, only '0's
Did you expérience whatever may cause a save to be incomplete (game grash during save, computer reboot, or anything ) ?
BTW : disabling autosaves may not be the smartest idea to do if you want safety.

I'll let the topic here, because even if I don't see how it could be a problem due to the game, I've seen such posts a pair of times, and I start to doubt.
I've seen this multiple times as well, but usually with config files. It's always the same symptoms – file is approximately the correct size, but at least partially filled with zeroes, seems to happen on Windows only and nobody ever can name anything suspicious happening when the file was being saved.

I'm leaning toward this being a Factorio bug, but unfortunately people have been reporting this for years and we still have no clue what might be causing it.

Zavian
Smart Inserter
Smart Inserter
Posts: 1064
Joined: Thu Mar 02, 2017 2:57 am

Re: Corrupted save file of 110+ hour game save

Post by Zavian » Mon Nov 20, 2017 6:44 pm

Not sure whether you are already doing this but StackExchange and https://disruptivesql.wordpress.com/201 ... e-through/ both suggest that calling FlushFileBuffers() ( https://msdn.microsoft.com/en-us/librar ... s.85).aspx ) will ensure the data is flushed to disk. (Assuming the disk itself doesn't lie to windows).

posila
Factorio Staff
Factorio Staff
Posts: 2677
Joined: Thu Jun 11, 2015 1:35 pm

Re: Corrupted save file of 110+ hour game save

Post by posila » Mon Nov 20, 2017 7:22 pm

Zavian wrote:Not sure whether you are already doing this but StackExchange and https://disruptivesql.wordpress.com/201 ... e-through/ both suggest that calling FlushFileBuffers() ( https://msdn.microsoft.com/en-us/librar ... s.85).aspx ) will ensure the data is flushed to disk. (Assuming the disk itself doesn't lie to windows).
We are using standard C functions for writing files. Thanks for the tip, Rseding had theory it is something wrong with OS not flushing files properly. We'll give it a try and see if this stops happening to people.

Leosmellsgood
Inserter
Inserter
Posts: 28
Joined: Fri Jan 16, 2015 10:35 am

Re: Corrupted save file of 110+ hour game save

Post by Leosmellsgood » Mon Nov 20, 2017 7:51 pm

Koub wrote:Your save file is incomplete : from byte 0x01400000 (around 20 MB) up to the end of file, it's totally blank, only '0's
Did you expérience whatever may cause a save to be incomplete (game grash during save, computer reboot, or anything ) ?
BTW : disabling autosaves may not be the smartest idea to do if you want safety.

I'll let the topic here, because even if I don't see how it could be a problem due to the game, I've seen such posts a pair of times, and I start to doubt.

Nothing was unusual about the saving and exiting process that I can remember, and saving takes about 30-60 seconds so I'd really rather leave autosave off.

posila
Factorio Staff
Factorio Staff
Posts: 2677
Joined: Thu Jun 11, 2015 1:35 pm

Re: Corrupted save file of 110+ hour game save

Post by posila » Sun Dec 17, 2017 12:42 pm

I tried FlushFileBuffers ( resp. _commit https://msdn.microsoft.com/en-us/library/17618685.aspx ), but it blocked the game on saving 40MB save to HDD (WD Black) for up to a second ... then I read https://blogs.msdn.microsoft.com/oldnew ... 0/?p=95505 so I think we should never need to call _commit, and corrupting save + all autosaves in this way can't possibly be due to HDD not having enought time to flush its internal cache.

So this is still open mystery.

Zavian
Smart Inserter
Smart Inserter
Posts: 1064
Joined: Thu Mar 02, 2017 2:57 am

Re: Corrupted save file of 110+ hour game save

Post by Zavian » Sun Dec 17, 2017 8:04 pm

I was hoping that because it blocks until the write is complete, FlushFileBuffers() would give you an error even if anti-virus blocked the disk write, or the device driver or disk reset before the write completed. If _commit isn't blocking then it probably is just ordering the disks/device drivers to flush the necessary caches and isn't waiting until the file is on the disk, and hence might not be able to report those errors.

@Leosmellsgood, personally I would leave autosave on, but just set it to every 20 or 30 mins. (Be aware that is in game time, so if you are only getting 30 ups, 30 mins is actually every hr of playtime). In addition I make a manual save at the end of a session, with each savename ending in a number that I increment each time.

Post Reply

Return to “1 / 0 magic”