jjohnsnaill / SubworldLibrary

Dimensions in Terraria, made easy.
44 stars 24 forks source link

Loading subworld server fails and client get stuck at saving world 100% #33

Closed jalea98 closed 8 months ago

jalea98 commented 11 months ago

I was playing with a dedicated server and came across the same bug as other players, the game fail to load the subworld and the clients get stuck at 100% loading screen.

Here are the server logs, as you can see in the server2. log the second server crashes trying to save the world data Server logs

The error thrown at the second server is:

[14:56:44.348] [Main Thread/FATAL] [tML]: Main engine crash

Tip: This is likely a mod's fault. Disable mods one by one and check if the issue persists

System.ArgumentNullException: Value cannot be null. (Parameter 'source')
   at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Linq.Enumerable.Select[TSource,TResult](IEnumerable`1 source, Func`2 selector)
   at MagicStorage.Common.Systems.StorageWorld.SaveWorldData(TagCompound tag) in MagicStorage\Common\Systems\StorageWorld.cs:line 100
   at Terraria.ModLoader.IO.WorldIO.SaveModData() in tModLoader\Terraria\ModLoader\IO\WorldIO.cs:line 490
   at Terraria.ModLoader.IO.WorldIO.Save(String path, Boolean isCloudSave) in tModLoader\Terraria\ModLoader\IO\WorldIO.cs:line 27
   at Terraria.IO.WorldFile.InternalSaveWorld(Boolean useCloudSaving, Boolean resetTime) in tModLoader\Terraria\IO\WorldFile.cs:line 709
   at Terraria.IO.WorldFile.<>c__DisplayClass58_0.<SaveWorld>b__0() in tModLoader\Terraria\IO\WorldFile.cs:line 640
   at Terraria.Utilities.FileUtilities.ProtectedInvoke(Action action) in tModLoader\Terraria\Utilities\FileUtilities.cs:line 207
   at DMD<System.Void Terraria.IO.WorldFile:SaveWorld(System.Boolean, System.Boolean)>(Boolean useCloudSaving, Boolean resetTime)
   at SyncProxy<System.Void Terraria.IO.WorldFile:SaveWorld(System.Boolean, System.Boolean)>(Boolean , Boolean )
   at Terraria.IO.WorldFile.SaveWorld() in tModLoader\Terraria\IO\WorldFile.cs:line 615
   at SubworldLibrary.SubworldSystem.LoadSubworld(String path, Boolean cloud) in SubworldLibrary.cs:line 2236
   at SubworldLibrary.SubworldSystem.LoadWorld() in SubworldLibrary.cs:line 2108
   at SubworldLibrary.SubworldSystem.LoadIntoSubworld() in SubworldLibrary.cs:line 1883
   at DMD<System.Void Terraria.Main:DedServ_PostModLoad(System.Boolean&)>(Main this, Boolean& reloadMods)
   at SyncProxy<System.Void Terraria.Main:DedServ_PostModLoad(System.Boolean&)>(Main , Boolean& )
   at Terraria.Main.DedServ() in tModLoader\Terraria\Main.cs:line 4516
   at Terraria.Program.RunGame() in tModLoader\Terraria\Program.cs:line 262

I don't know if the issue should be in here as the log also says the exception is thrown by Magic storage mod at the moment of saving the world.

Also I tasted a little and this error just happen the first time the sub world is saved, after that the second server loads well and the player connects correctly. this was tasted by disabling magic storage and then loading a subworld, after that it loads ok even after enabling magic storage again.

full mod list:

jjohnsnaill commented 8 months ago

Yeah this looks like a Magic Storage crash. Probably fixed by now.