This question was created in reference to: [Setup custom crash report [Content removed]
In any project, add the following to DefaultEngine.ini
[CrashReportClient]
bAgreeToCrashUpload=true
DataRouterURL="<insert URL here>"
From the IDE (ex: JetBrains Rider), launch a project in the Editor in Development mode with `-game` as one of the arguments.
Once the project is launched, type the backtick key (`) and then type Debug Crash to crash the game and summon the Crash Report Client. Click “Send.”
If the DataRouterURL points to a local Python Flask server, the Crash Report Client will send files in a zlib-compressed string to the local URL:
DataRouterUrl="http://127.0.0.1:5000/crashreport"
However, if DataRouterURL points to an Azure cloud function URL that is 138 characters long, data will not be received by that URL. I’d like to look at the logs for the Crash Report Client to see if the Crash Report Client is sending trying to send data to that URL, but I cannot find them under:
Engine/Programs/CrashReportClient/Saved/Logs
I see a “Config” folder under the CrashReportClient folder, but no “Saved/Logs” folder.
Steps to Reproduce
Open the project in an IDE.
Use these arguments to launch the project in `-game` mode:
-log -game -WINDOWED ResX=1280 ResY=720 -Log=BlankCrashTest.log -Log -NewConsole
When the project finishes loading, hit the backtick key to enter console commands. Type Debug Crash and hit Enter to crash the project.
[Image Removed]
Click “Send and Close” when the Crash Report Client shows up.
Open the Engine\Programs\CrashReportClient folder. No “Saved\Logs” folder will be present. There is no log for the CrashReportClient activity.
This is the ZIP file containing the project mentioned in “Steps to Reproduce.”
Wireshark is able to capture communications between Crash Reporter Client and the Azure cloud function. However, Azure does not show any of this activity in its logs. I’m hoping to find the communication from the Crash Reporter Client to understand what’s going wrong.
Hi,
If you have CrashReportClientEditor.exe compiled in Shipping, you will find the logs in the AppData folder. Ex: C:\Users\${YouUserName}\AppData\Local\CrashReportClient\Saved\Logs\CrashReportClient.log. With UE, I find it very useful to use a free tool like ‘Everything’ which index all the files on your disk, then you can search for ‘CrashReportClient*log’ to find all the files at once. The Debug/Development version of CrashReportClient should save it logs into Engine/Programs/CrashReportClient/Saved/Logs but if you have the shipping version available, the Editor will prefer launching the shipping exe instead.
While the logs are going to help, you can also attach to CrashReportClientEditor.exe and debug it. The Editor launch CrashReportClientEditor.exe in background and it uses it to send the report. So you just need to open your IDE and attach to the running CrashReportClientEditor.exe process. Then you can put a breakpoint into the functions below then trigger the crash with ‘debug crash’ console command.
D:\UE_5.6\Engine\Source\Programs\CrashReportClient\Private\CrashReportClient.cpp
FReply FCrashReportClient::Submit(bool bIncludeOptionalAttachments)
{
...
}
bool FCrashReportClient::Tick(float UnusedDeltaTime)
{
...
}
D:\UE_5.6\Engine\Source\Programs\CrashReportClient\Private\CrashReportClientApp.cpp
SubmitCrashReportResult RunWithUI(FPlatformErrorReport ErrorReport, bool bImplicitSend)
{
...
// Detect if ensure, if user has selected to restart or close.
if (CrashReportClient->WasClosedWithoutSending())
{
return SuccessDiscarded;
}
else if (CrashReportClient->IsUploadComplete())
{
return CrashReportClient->GetIsSuccesfullRestart() ? SuccessRestarted : (FPrimaryCrashProperties::Get()->bIsEnsure ? SuccessContinue : SuccessClosed);
}
}
Note the for a game, CrashReportClient.exe doesn’t run in background, but you can start your game with -waitforattachcrc argument, so if the game crash, it should launch CrashReportClient.exe with -waitforattach argument, making it loop at startup until you attach the debugger. It’s very useful to debug crash reporting.
Regards,
Patrick
Hi,
If I remember correctly, the settings would work for a game, but for privacy/legal reasons in the Editor they don’t. Those settings changed a lot a couple of years ago but I can’t remember what and why, but as of today, you can run the Editor with -game -unattended if you want, the -unattended will be propagated to CrashReportClientEditor.exe and you should not get any UI prompt for CRC nor the Editor (I didn’t test, but the code is clear enough). Typically, -unattended is used to run automated tests and might not be desirable for you, so alternatively, you could also set the following CVar in your game WindowsEngine.ini (I tested setting it directly in the Editor prompt before entering debug crash)
${Game}\Config\Windows\WindowsEngine.ini
[ConsoleVariables]
WindowsPlatformCrashContext.ForceCrashReportDialogOff 1
Both options mentioned above will affect the following code in \Engine\Source\Programs\CrashReportClient\Private\CrashReportClientApp.cpp
const bool bNoDialog = (CrashContext.UserSettings.bNoDialog || CrashContext.UserSettings.bImplicitSend) && CrashContext.UserSettings.bSendUnattendedBugReports;And the bNoDialog variable value control showing the UI or not.
Regards,
Patrick
Thank you so much! You are a lifesaver. Using Everything, I located the CRC logs here:
C:\Users\<username>\AppData\Local\CrashReportClient\Saved\LogsI was also able to attach my debugger to the points you posted upthread.
The logs revealed that -- as far as CRC knew -- the uploads posted without a hitch.
The culprit turned out to be a non-anonymous Azure Cloud Function endpoint. I replaced this line:
public async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Function, "post")] HttpRequest req)…with this line to make it Anonymous (not requiring a `?code=<key>` at the end of the URL):
public async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequest req)The CRC reports are now uploading without a hitch. Thank you for helping me track this down!
---
One more question -- the Crash Reporting docs claim that this is all one needs to silently submit “unattended” crash reports:
[CrashReportClient]
bAgreeToCrashUpload=true
bSendUnattendedBugReports=true
However, when I run the project from my IDE using `-game` and deliberately crash using `Debug Crash`, the Crash Report Client UI appears no matter what. Do these two settings only affect packaged builds, or is there a way to test “unattended” crash reports in `-game` mode?
Thanks again for your help,
Jen