question

aeg89 avatar image
aeg89 asked

UE4 Dedicated Server Unhealthy. Cannot verify containerization

Hi,

I'm trying to deploy a UE4 dedicated server build with no success and I have tried everything I found in the forum but I'm stuck in the 'Verify containerization' step of the documentation and I don't know how to debug this and get more info about what's happening in the container.

I built UE4.26 from source code and added the PlayfabPlugin source code to use it as a built-in plugin in the project. Then I followed the UE4 docs to set up a dedicated server build. Then I followed every step in this guide to integrate Playfab in the project and deploy it:

https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/servers/playfabgsdk_guide

I downloaded the nuget package (cppgsdk.v140.0.7.200221), modified the FDefaultModuleImpl and the build.cs file as the guide does, but adding a few extra dll's just in case:

RuntimeDependencies.Add("$(TargetOutputDir)/vcruntime140_1.dll", "$(EngineDir)/Binaries/ThirdParty/AppLocalDependencies/Win64/Microsoft.VC.CRT/vcruntime140_1.dll", StagedFileType.SystemNonUFS); RuntimeDependencies.Add("$(TargetOutputDir)/XAudio2_7.dll", "$(EngineDir)/Binaries/ThirdParty/AppLocalDependencies/Win64/DirectX/XAudio2_7.dll", StagedFileType.SystemNonUFS); RuntimeDependencies.Add("$(TargetOutputDir)/XAPOFX1_5.dll", "$(EngineDir)/Binaries/ThirdParty/AppLocalDependencies/Win64/DirectX/XAPOFX1_5.dll", StagedFileType.SystemNonUFS); RuntimeDependencies.Add("$(TargetOutputDir)/X3DAudio1_7.dll", "$(EngineDir)/Binaries/ThirdParty/AppLocalDependencies/Win64/DirectX/X3DAudio1_7.dll", StagedFileType.SystemNonUFS);RuntimeDependencies.Add("$(TargetOutputDir)/GFSDK_Aftermath_Lib.x64.dll","$(EngineDir)/Binaries/ThirdParty/NVIDIA/NVaftermath/Win64/GFSDK_Aftermath_Lib.x64.dll", StagedFileType.SystemNonUFS);

I have disabled the WindowsMedia plugin also, along with any experimental / beta plugin I found, I have set the TitleID and DeveloperSecretKey and I have checked/unchecked this 'Verify Peer' thing and ensured it is added to the DefaultEngine file, so it looks like this:

// more config stuff...

[/Script/PlayfabCommon.PlayfabRuntimeSettings]

TitleId=XXXXX

DeveloperSecretKey=XXXXXXXXXXXXXXXX

[/Script/Engine.NetworkSettings]

n.VerifyPeer=True

[/Script/AndroidRuntimeSettings.AndroidRuntimeSettings]

bBuildForX8664=True

bBuildForArm64=True

Then I use the project launcher with the same settings as in the guide to create the Server.exe, but I check the 'include as installer for prerequisites of packaged games' option in case that could be a problem.

I copy all the files but the Server.exe from the WindowsServer/Path-to-Win64 folder into the root folder and I also add every dll I have found using Process Exporer v16.32 (which seems to be a valid substitute for the listdll command, I guess) in both root and Win64 folders.

Finally I use the settings from the guide to deploy de zip and I get a nice Unhealthy build with TooManyRestarts, so I followed the steps from the 'locally debugging game servers...' section of the guide and I can succesfully verify GSDK integration and spawn two players/clients in the server's MainMap while the server is in 'StandBy' and 'Active' state as shown below:

I can see the logs from the StartupModule() so I guess everything is fine here and the plugin is properly integrated. Then to test the connection I have a separate build that sends a Client to the 'MainMap' using the 'open 127.0.0.1:7777' command and I verify that I can connect two players:

Then when the MockVM termitates the server the players are sent back to the original 'Lobby Map' so I guess that means the build is fine and the plugin correctly integrated, but when I try to run it inside the container it gets stuck in the 'Waiting for heartbeats...' state and generates no logs in the PlayfabVMOutput/GameLogs folder when I force it to shut down.

But if I run the executable located in the Win64 folder like this:

"ContainerStartParameters": {

"StartGameCommand": "C:\\Assets\\PfabServer\\Binaries\\Win64\\PfabServerServer.exe -log",

///etc

}

I get a 'container exited with code 1' and this log in the GameLogs folder:

{"log":"Running Startup Script\n","stream":"stdout","time":"2021-03-27T20:08:12.2279027Z"} {"log":"Certificates located at: C:\\GameCertificates\n","stream":"stdout","time":"2021-03-27T20:08:12.2469024Z"}

If I get into the container as the documentation says, I can see my assets are correctly mounted and If I RDP into the VM of the deployed build and I try to run the executable located in : D:\ExtAssets\SH0\A0 I get this errors:

"The procedure entrypoint CheckIsMSIPackage could not be located in the dynamic link library D:\ExtAssets\SH0\A0\PfabServer\Binaries\Win64\dxgi.dll"

and I get the same for opengl32.dll, d3d9.dll and UIAutomationCore.DLL, but those dlls do exist in that folder so... anyways, I'm not sure If the game build can be executed in inside the VM like I'm doing, but here's everything I have tried.

As I said, I have no idea about how to get more info about the 'exit with code 1' problem and any help would be appreciated. Maybe I'm missing some server configuration needed to run the exe?

If I can connect to the server when I run the MockVmAgent with "RunContainer": false, I should be able to, at least, deploy the server build running the MainMap without players, right?

TitleID is FC976 by the way, and thank you in advance.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Rick Chen avatar image
Rick Chen answered

Have you followed this document Locally debugging game servers and integration with PlayFab to set up local debug tools? I noticed that your container StartGameCommand is "C:\\Assets\\PfabServer\\Binaries\\Win64\\PfabServerServer.exe -log". Please do not zip a folder within a folder in the zip. After zipping, browse the zip folder and double-check that your compression software did not add an extra layer of file hierarchy.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Rahul Sode avatar image
Rahul Sode answered

Hi, I am facing the same problem and there is nothing in documentation or the server to help me out here

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Rahul Sode avatar image Rahul Sode commented ·

I was able to solve it by replacing those dll files from my windows system folders, dont know why nobody mentioned it, but the DLLs(opengl32.dll, d3d9.dll and UIAutomationCore.DLL) that get packaged while building the server do not work. and needed to be replace by files from windows system folders

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.