Why does my dedicated server crashes when loading a map that uses the water plugin?

Hey all, i am using the engine’s default water plugin, with buoyancy. My level “OceanMap” is an open world map with a large terrain, streaming and most importantly, i added a “Water Body Ocean” from the engine’s water plugin (which added a WaterZone and Landscape_WaterBrushManager for my landscape). It’s set as server default map.

OceanMap works perfectly fine on standalone game.
I start the server via <UnrealEditor.exe> <path>.uproject -log -server

Problem is, when i start the server, it crashes. Here are parts of the log i find relevant (Water mentionned):

Earlier in the startup:

LogWorldPartition: UWorldPartition::Initialize Context : World NetMode = Dedicated Server, IsServer = 1, IsDedicatedServer = 1, IsServerStreamingEnabled = 0, IsServerStreamingOutEnabled = 0, IsUsingMakingVisibleTransaction = 0, IsUsingMakingInvisibleTransaction = 0
LogAssetRegistry: Warning: ScanPathsSynchronous: Package /Script/WaterEditor.WaterBrushManager does not exist, will not scan.
LogWorldPartition: Can't find class descriptor '/Script/WaterEditor.WaterBrushManager' for loading '/Game/ThirdPerson/Maps/OceanMap.OceanMap:PersistentLevel.Landscape_WaterBrushManager_0', using '/Script/Engine.Actor'
LogWorldPartition: Warning: Invalid class for actor guid `9278FBD645977A8F77EA53BC30D51754` ('Landscape_WaterBrushManager_0') from package '/Game/__ExternalActors__/ThirdPerson/Maps/OceanMap/1/HE/DZKL0SW3RKTBV7WQ30BBOO'
LogWorldPartition: Warning: Invalid actor native class: Actor: 'Landscape_WaterBrushManager_0' (guid '9278FBD645977A8F77EA53BC30D51754') from package '/Game/__ExternalActors__/ThirdPerson/Maps/OceanMap/1/HE/DZKL0SW3RKTBV7WQ30BBOO'

And the error:

LogWindows: Error: === Critical error: ===
LogWindows: Error: 
LogWindows: Error: Fatal error!
LogWindows: Error: 
LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000000
LogWindows: Error: 
LogWindows: Error: [Callstack] 0x00007ffd542cc41b UnrealEditor-Water.dll!`FWaterBodyMeshBuilder::BuildWaterInfoMeshes'::`2'::<lambda_1>::operator()() [C:\Unreal\Engine\Plugins\Experimental\Water\Source\Runtime\Private\WaterBodyMeshBuilder.cpp:62]
LogWindows: Error: [Callstack] 0x00007ffd542e180e UnrealEditor-Water.dll!FWaterBodyMeshBuilder::BuildWaterInfoMeshes() [C:\Unreal\Engine\Plugins\Experimental\Water\Source\Runtime\Private\WaterBodyMeshBuilder.cpp:69]
LogWindows: Error: [Callstack] 0x00007ffd54350d06 UnrealEditor-Water.dll!UWaterBodyComponent::UpdateWaterInfoMeshComponents() [C:\Unreal\Engine\Plugins\Experimental\Water\Source\Runtime\Private\WaterBodyComponent.cpp:1962]
LogWindows: Error: [Callstack] 0x00007ffd54350763 UnrealEditor-Water.dll!UWaterBodyComponent::UpdateWaterBodyRenderData() [C:\Unreal\Engine\Plugins\Experimental\Water\Source\Runtime\Private\WaterBodyComponent.cpp:1925]
LogWindows: Error: [Callstack] 0x00007ffd54318fce UnrealEditor-Water.dll!UWaterBodyComponent::OnPostRegisterAllComponents() [C:\Unreal\Engine\Plugins\Experimental\Water\Source\Runtime\Private\WaterBodyComponent.cpp:1516]
LogWindows: Error: [Callstack] 0x00007ffd54318ffe UnrealEditor-Water.dll!UWaterBodyOceanComponent::OnPostRegisterAllComponents() [C:\Unreal\Engine\Plugins\Experimental\Water\Source\Runtime\Private\WaterBodyOceanComponent.cpp:476]
LogWindows: Error: [Callstack] 0x00007ffd54325553 UnrealEditor-Water.dll!AWaterBody::PostRegisterAllComponents() [C:\Unreal\Engine\Plugins\Experimental\Water\Source\Runtime\Private\WaterBodyActor.cpp:679]
LogWindows: Error: [Callstack] 0x00007ffd6f4db343 UnrealEditor-Engine.dll!AActor::IncrementalRegisterComponents() [C:\Unreal\Engine\Source\Runtime\Engine\Private\Actor.cpp:5495]
LogWindows: Error: [Callstack] 0x00007ffd7054ed8d UnrealEditor-Engine.dll!ULevel::IncrementalRegisterComponents() [C:\Unreal\Engine\Source\Runtime\Engine\Private\Level.cpp:1755]
LogWindows: Error: [Callstack] 0x00007ffd7054f4a8 UnrealEditor-Engine.dll!ULevel::IncrementalUpdateComponents() [C:\Unreal\Engine\Source\Runtime\Engine\Private\Level.cpp:1674]
LogWindows: Error: [Callstack] 0x00007ffd7192129d UnrealEditor-Engine.dll!UWorld::UpdateWorldComponents() [C:\Unreal\Engine\Source\Runtime\Engine\Private\World.cpp:2636]
LogWindows: Error: [Callstack] 0x00007ffd718e8167 UnrealEditor-Engine.dll!UWorld::InitializeActorsForPlay() [C:\Unreal\Engine\Source\Runtime\Engine\Private\World.cpp:5160]
LogWindows: Error: [Callstack] 0x00007ffd7174a0bf UnrealEditor-Engine.dll!UEngine::LoadMap() [C:\Unreal\Engine\Source\Runtime\Engine\Private\UnrealEngine.cpp:15492]
LogWindows: Error: [Callstack] 0x00007ffd716d00ea UnrealEditor-Engine.dll!UEngine::Browse() [C:\Unreal\Engine\Source\Runtime\Engine\Private\UnrealEngine.cpp:14670]
LogWindows: Error: [Callstack] 0x00007ffd702b6409 UnrealEditor-Engine.dll!UGameInstance::StartGameInstance() [C:\Unreal\Engine\Source\Runtime\Engine\Private\GameInstance.cpp:659]
LogWindows: Error: [Callstack] 0x00007ffd701e47f1 UnrealEditor-Engine.dll!UGameEngine::Start() [C:\Unreal\Engine\Source\Runtime\Engine\Private\GameEngine.cpp:1223]
LogWindows: Error: [Callstack] 0x00007ff609782eec UnrealEditor.exe!FEngineLoop::Init() [C:\Unreal\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:4919]
LogWindows: Error: [Callstack] 0x00007ff6097ae255 UnrealEditor.exe!GuardedMain() [C:\Unreal\Engine\Source\Runtime\Launch\Private\Launch.cpp:164]
LogWindows: Error: [Callstack] 0x00007ff6097ae42a UnrealEditor.exe!GuardedMainWrapper() [C:\Unreal\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:118]
LogWindows: Error: [Callstack] 0x00007ff6097b18a4 UnrealEditor.exe!LaunchWindowsStartup() [C:\Unreal\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:258]
LogWindows: Error: [Callstack] 0x00007ff6097c70c4 UnrealEditor.exe!WinMain() [C:\Unreal\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:298]
LogWindows: Error: [Callstack] 0x00007ff6097ca37a UnrealEditor.exe!__scrt_common_main_seh() [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
LogWindows: Error: [Callstack] 0x00007ffe395d7344 KERNEL32.DLL!UnknownFunction []
LogWindows: Error: 

Looks like the water dll fails to load

Clearing intermediate, binaries, build and saved and rebuilding didn’t work. Right now i am trying to replicate this in a minimal project.

Looks like it’s not creating a valid StaticMesh in the WaterBodyMeshBuilder, though it should only be running any of that code if WITH_EDITOR is true.

You could try packaging the Dedicated Server and see if it crashes the same way.

Thanks, when packaged it runs correctly, but the server is not found by the client.
The client gives me a log line with something like:
Server [My public IP] failed to respond
Before i had the water issue i had this issue, which i fixed, clients could connect to the server. And i started having the water issue when i made the server’s map contain water. No clue how i fixed it though. Maybe the reason it stopped working is linked to the fact that my .ini files keep changing by themselves?

I have the same DLL issue in the EOS based dedicated server i made, but i can connect to it when the game is packaged. Although i would like a more definitive fix for this issue, as having to package everytime i want to test out a change harms productivity by a lot.

I think you’re going to have to make an engine change to make it work with editor binaries.

Looks to me like the best spot is in WaterBodyComponent.cpp in UWaterBodyComponent::UpdateWaterInfoMeshComponents.

Add in a dedicated server check that returns out of the function before it gets to the meshbuilder call.

Also would be a good idea to report the issue in the bug tracker.

2 Likes

Worked! I added an early return before it that checked if we were on a dedicated server.

@OP, did you report this bug to the bug tracker? Can you share the tracker number?

I made a quick PR here: https://github.com/EpicGames/UnrealEngine/pull/12152