Following my quest to get UE4 server crash dumps out of a container (see here for the first part), I now face a new issue :
When the server crashes, the process ends and the container is recycled before the dump is sent to external service through HTTP.
Two issues here :
- UE4 crash reporter needs DirectX to be installed :( to even have a chance to start. How could that be done from within server 2.0 containers ?
- Even when everything is installed (I cheated and did it manually from RDP once connected to a running VM, for test purposes), the process does not have the time to do its job before the container gets recycled.
[Edit]: Removed comments related to issues I cannot reproduce anymore...
Trying to address point 2. and following Jay Zuo's kind suggestion (see link to other thread above), I tried to wrap server's exe. Here is the result of my experimentation :
@echo off rem Start dedicated server. echo [%time%] Starting Server.exe...>C:\GameLogs\Wrapper.log C:\Assets\Server.exe ABSLOG=C:\GameLogs\Server.log echo [%time%] Server.exe stopped. Waiting for CrashReportClient.exe to stop...>>C:\GameLogs\Wrapper.log rem Wait for crash reporter to finish its work. set /A waitLoopCount = 5 :waitForCrashReportClient rem tasklist does not set ERRORLEVEL when no process is found, but find does... Chain commands ! tasklist /FO CSV /NH /FI "IMAGENAME eq CrashReportClient.exe" | find /I "CrashReportClient.exe" >nul 2>&1 rem Crash reporter is not running. Wait for it to start. if ERRORLEVEL 1 ( echo [%time%] CrashReportClient.exe is not running>>C:\GameLogs\Wrapper.log rem We waited enough. Either we missed it or the server did not crash. Give up. if %waitLoopCount% LEQ 1 ( goto terminate rem Maybe it did not start yet, wait again. ) else ( set /A waitLoopCount = waitLoopCount-1 rem timeout command returns immediately if there is no stdin, which is the case in a container. Use ping instead. ping 192.0.2.1 -n 1 -w 1000 >nul goto waitForCrashReportClient ) rem Crash reporter is still running, Wait for it to complete. ) else ( echo [%time%] CrashReportClient.exe is still running>>C:\GameLogs\Wrapper.log set /A waitLoopCount = 0 rem timeout command returns immediately if there is no stdin, which is the case in a container. Use ping instead. ping 192.0.2.1 -n 1 -w 1000 >nul goto waitForCrashReportClient ) :terminate echo [%time%] Terminating...>>C:\GameLogs\Wrapper.log
Seems to be working fine when run locally. I could not test it from within a container (the issue 1.)