question

Mathieu Deletrain avatar image
Mathieu Deletrain asked

How to wait for UE4's CrashReportClient to be done from server 2.0 container ?

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 :

  1. 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 ?
  2. 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.)

Matchmakingmultiplayer
10 |1200

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

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

So the main problem is around issue 1, however, our window container image doesn’t have DirectX installed (not that I am aware of). It’s possible that you could run a silent DirectX installer (bundled in your assets) with your startup script, prior to the execution of the UE4 server.

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.

Mathieu Deletrain avatar image Mathieu Deletrain commented ·

Unreal's crash report client was actually needing more Windows subsystems. Namely :

  • dxcore.dll
  • D3DCompiler_43.dll
  • msvcp140.dll
  • vcruntime140_1.dll
  • umpdc.dll
  • kernel.appcore.dll
  • windows.storage.dll

That's DirectX, VC redist and some other I couldn't identify.

I ended up embeding all needed dlls instead of trying to install all dependencies at start time.

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.

Error rendering WebPanel (widgets/consolidation-widget.ftl): org.hibernate.hql.internal.ast.QuerySyntaxException: AvailableConsolidation is not mapped [from AvailableConsolidation up where up.node = :node]