Exception: Incorrect region file header!

arramus

Refugee
Version
V2.5 (b23)
Platform
Windows
Region/r.0.-2.7rg of a current World Save has corrupted with an Exception: Incorrect region file header! warning.
This type of issue has been posted from time to time over the Alphas, and is generally resolved by deleting the Region or simply starting a new world.
It is possible to restore the region file header using a HEX Editor for the particular region file, but the result can be unstable and is certainly not ideal.
However, it can assist with understanding what content needs to be restored from creative before a full region purge.

In this case, this is a non modded server set up for cross platform to allow console players to enjoy the community experience.
This issues appears from time to time, and for the last few times I have experienced it, there is generally a pattern to the corruption.

In the last few examples I have seen.
1. The corruption occurs where a player base borders 2 regions.
2. The corruption occurs where a Land Claim Block is bordering 2 separate regions.

We rolled back to a Region save 24 hours before the corruption occurred and it was accepted and worked out for about another 3 game play hours.
The corruption then occurred during game play. This log shows the initial corruption which presented itself after a server restart.

C61AIKJ.jpeg

Post automatically merged:

I kept the corrupt Region file, and can share it for review if required.
 
Reproduction Steps
Set up a base with a Land Claim Block bordering 2 separate region files.
Link to Logs
https://pastebin.com/H42xuzf6
Link to Screenshot/Video
https://i.imgur.com/C61AIKJ.jpeg
As a follow up, this shows the exception error for a real time corruption of the back up save which was used to restore the Region once the play through had continued.
XML:
2026-01-06T13:56:49 19300.796 ERR EXCEPTION: In load chunk (chunkX=0 chunkZ=-39)
2026-01-06T13:56:49 19300.796 EXC Incorrect region file header! C:\TCAFiles\Users\kyle45\180644\userdata\Saves\SurviveSeason8K03\gamename\Region/r.0.-2.7rg
  at RegionFileSectorBased.Get (System.String dir, System.Int32 rX, System.Int32 rZ, System.String ext) [0x00061] in <036aa33de93148cfa14fd53ce48d7b23>:0
  at RegionFileAccessSectorBased.OpenRegionFile (System.String _dir, System.Int32 _regionX, System.Int32 _regionZ, System.String _ext) [0x00000] in <036aa33de93148cfa14fd53ce48d7b23>:0
  at RegionFileAccessMultipleChunks.GetRFC (System.Int32 _regionX, System.Int32 _regionZ, System.String _dir, System.String _ext) [0x00067] in <036aa33de93148cfa14fd53ce48d7b23>:0
  at RegionFileAccessMultipleChunks.GetInputStream (System.String _dir, System.Int32 _chunkX, System.Int32 _chunkZ, System.String _ext) [0x0000c] in <036aa33de93148cfa14fd53ce48d7b23>:0
  at RegionFileChunkReader.readIntoLoadStream (System.String _dir, System.Int32 chunkX, System.Int32 chunkZ, System.String ext, System.UInt32& version) [0x00000] in <036aa33de93148cfa14fd53ce48d7b23>:0
  at ChunkSnapshotUtil.LoadChunk (System.String dir, System.Int64 key) [0x0000e] in <036aa33de93148cfa14fd53ce48d7b23>:0
UnityEngine.StackTraceUtility:ExtractStringFromException(Object)
Log:Exception(Exception)
ChunkSnapshotUtil:LoadChunk(String, Int64)
RegionFileManager:GetChunkSync(Int64)
ChunkProviderGenerateWorld:GenerateSingleChunk(ChunkCluster, Int64, Boolean)
ChunkProviderGenerateWorld:GenerateChunksThread(ThreadInfo)
ThreadManager:myThreadInvoke(Object)
System.Threading.ThreadHelper:ThreadStart_Context(Object)
System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
System.Threading.ExecutionContext:Run(ExecutionContext, ContextCallback, Object, Boolean)
System.Threading.ExecutionContext:Run(ExecutionContext, ContextCallback, Object)
System.Threading.ThreadHelper:ThreadStart(Object)

This starts a cascade of errors specifically related to differing
XML:
In load chunk (chunkX=# chunkZ=-##)
variables.
 
Here is a sample of that log from the very first instance to a little of the cascade. I can't share it all as it's just too much data for pastebin type allowances.
At that stage the server was just over 5 hours into a cycle, and not too far from a scripted restart.
Since this server is used by a TFP Creator, it is regulated carefully to ensure live streams showcase rather than struggle.
From 2026-01-06T08:35:08
To 2026-01-06T13:56:39
The Exception occured from this point with the back up in an attempt to recover from the first Exception.
 
I agree. I'm encountering this issue. There are 6 servers, and on 4 of them this occurs at various intervals. It can work fine for 2 days, and on the 3rd, break the region. I'll restore it, and in an hour it happens again. And then everything is fine again for 3 days. This is exclusively on the 2.5 map. I loaded the 2.4 map, and there are no problems with it.
 
Yea I am getting bad corruption as well, just finished going over mods with a fine tooth comb. Even coded out the beehives to be sure. But today it corrupted again. Its strange because I haven't seen corruption like this since 2.0 patch when one of the pois was bugged.
 
Thanks for adding to the post, PuffDragon. I can see the 7 Days Admin community is having a really hard time of it recently, and I feel for those Admin who are trying to manage multiple community servers, as it's become a constant battle to save and maintain.
 
I had my first corruption on the 18th of December I think we where still during experimental. A player actually told me that as soon as he accessed the apiary he got disconnected, I checked the logs and it's when the region got corrupted. So many players had them placed that it was impossible to clear all of them out and we ended up having to wipe.

I removed the ability for players to craft them and never had an issue.
 
We made a few code changes to the apiary on our server. So far, they do not appear to be the cause for any of our issues. There are several players that have at least one in use. Our situation may be a bit different, though, since we use the Project-Z mod and some various other QoL mods. Right now, the only random crash we seem to get is Exit Code 139, with no apparent reason.

If you want to test and repair individual region files (or the whole /Region/ directory) check out this handy tool:
 
2026-01-14T06:46:24 18634.544 ERR ERROR: System.Exception: Incorrect region file header! C:\TEST\GeneratedWorlds\Saves\TEST\TEST\Region/r.-3.-1.7rg
at RegionFileSectorBased.Get (System.String dir, System.Int32 rX, System.Int32 rZ, System.String ext) [0x00061] in <036aa33de93148cfa14fd53ce48d7b23>:0
at RegionFileAccessSectorBased.OpenRegionFile (System.String _dir, System.Int32 _regionX, System.Int32 _regionZ, System.String _ext) [0x00000] in <036aa33de93148cfa14fd53ce48d7b23>:0
at RegionFileAccessMultipleChunks.GetRFC (System.Int32 _regionX, System.Int32 _regionZ, System.String _dir, System.String _ext) [0x00067] in <036aa33de93148cfa14fd53ce48d7b23>:0
at RegionFileAccessMultipleChunks.Write (System.String _dir, System.Int32 _chunkX, System.Int32 _chunkZ, System.String _ext, System.Byte[] _buf, System.Int32 _bufLength) [0x0000c] in <036aa33de93148cfa14fd53ce48d7b23>:0
at ChunkMemoryStreamWriter.Close () [0x0002a] in <036aa33de93148cfa14fd53ce48d7b23>:0
at RegionFileChunkWriter.WriteStreamCompressed (System.String dir, System.Int32 chunkX, System.Int32 chunkZ, System.String ext, System.IO.MemoryStream memoryStream) [0x00077] in <036aa33de93148cfa14fd53ce48d7b23>:0
at RegionFileChunkSnapshot.Write (RegionFileChunkWriter writer, System.String dir, System.Int32 chunkX, System.Int32 chunkZ) [0x00008] in <036aa33de93148cfa14fd53ce48d7b23>:0
at ChunkSnapshotUtil.WriteSnapshot (IRegionFileChunkSnapshot snapshot, System.String dir, System.Int32 chunkX, System.Int32 chunkZ) [0x00000] in <036aa33de93148cfa14fd53ce48d7b23>:0
at RegionFileManager.DoSaveChunks () [0x00244] in <036aa33de93148cfa14fd53ce48d7b23>:0
 
This has been fixed, was due to the aipary. That region fix tool can help. Also, the "rr" command should be used to rebuild regions if they are needed to be wiped completely.
 
Back
Top