I am running a large server and ran into a problem of the server's save file being corrupted, so I figured I would document my diagnosis and fix.
Symptoms
New generated chunks being nothing but void
/wgen regen generating empty chunks
Able to place blocks in empty chunks
Can move freely inside empty chunks
No error logs in world gen or server main log
Diagnosis steps:
First step I did was check to see if it was chunk corruption or a failure to generate new chunks. I did so by seeing if blocks could be placed inside the chunks that were showing signs of errors
I tested /wgen regen in several already generated older chunks to see if the problem was isolated to the world generation or just the regen command
I started a fresh save file with the same exact mods, configs, and seed to see if the issue was the server backend or a save file issue
After narrowing the issue down to the save file I read this wiki doc to see how the save file is contructed. https://wiki.vintagestory.at/Modding:VCDBS_format
After seeing the different tables and what purpose they serve, I concluded that the MapRegion table was corrupted.
The Fix
Generate back up of server save using:
Stop the server
Rename Default.vcdbs to: oldsave.vcdbs
Generate a new save file with the same mods, configs, and serverconfig. This can be done by starting the server again after changing the name of the save; afterwards stop the server.
*It is important that if you are changing minor terrain gen that you change it before this step.
Rename the new Default.vcdbs to newsave.vcdbs
Download SQLite3 via terminal command: (I am on a Ubuntu server)
Drag the old save file and the new save file into the same folder
Run this SQL command:
sqlite3 oldsave.vcdbs <<'SQL'
ATTACH DATABASE 'newsave.vcdbs' AS newdb;
DELETE FROM mapregion;
INSERT INTO mapregion (position, data)
SELECT position, data
FROM newdb.mapregion;
DETACH DATABASE newdb;
SQL
You can check if it worked by running:
sqlite3 oldsave.vcdbs "SELECT COUNT(*) FROM mapregion;"
It should have a really small number. mine was 16
Delete the new save file as it is no longer needed. It is named "newsave.vcdbs"
Rename the old save file back to: "Default.vcdbs"
Start the server
Run over to the old empty chunks and stand inside them.
Regenerate these chunks using the /wgen regen command
The empty chunks should regenerate as they did before.