sentry-unreal
sentry-unreal copied to clipboard
Occasional Error log during build "LogSentrySdk: Error: Sentry initialization failed"
Environment
How do you use Sentry? Sentry SaaS (sentry.io)
Which version of the SDK? 0.22
How did you install the package? (Git-URL, Assetstore) github
Which version of Unreal? 5.4
Is this happening in Unreal (editor) or on a player like Android, iOS, Windows? Editor at cook startup
Steps to Reproduce
- Start Cook
- Randomly run into error
- Error causes build to fail
Expected Result
No errors.
Actual Result
[2025.03.12-07.41.41:106][ 0]LogSentrySdk: Warning: failed to start crashpad client handler
[2025.03.12-07.41.41:117][ 0]LogSentrySdk: Warning: failed to initialize backend
[2025.03.12-07.41.41:128][ 0]LogSentrySdk: Warning: sentry_init failed
[2025.03.12-07.41.41:205][ 0]LogSentrySdk: Error: Sentry initialization failed.
Since any errors in the log cause the build to return with error this can be quite annoying.
@Darkere Thank you for bringing this up. Based on the above log it looks that Sentry engine's subsystem is re-initialized during the cook process for some reason. We'll try to reproduce this on our end and see what could cause such behavior.
This is fairly early in the cook process so reinitialization seems odd.
Could the issue be caused by us starting the cook commandlet process from inside another commandlet? Both commandlets run in parallel. We've also seen the issue when starting our cook process from the editor. Though I'm fairly certain the default Unreal cook process works similarly when started from the editor.
Though I don't imagine many studios using sentry launch cook through the editor.
@Darkere I haven't been able to reproduce this issue so far as the Sentry plugin initializes without errors when starting the cook both from the editor and via commandlet. Are there any additional steps required to recreate this error (e.g., specific environment setup, command runs, etc.)?
No. As mentioned in the title the error only occurs very occasionally. Build ran fine 20 times until we encountered the error again today.
Any chance this could be an internet connection issue or something similar?
Any chance this could be an internet connection issue or something similar?
That's unlikely as the plugin should be able to initialize without errors even when you're offline. Does this issue occur in CI environment or it's something that happens on your local dev machine? Is it Windows/Linux?
Not sure if that's the case but we've encountered somewhat similar initialization errors earlier when the crashpad executable had insufficient access rights (Linux) and dir where .sentry-native cache is supposed to be stored was read-only.
Its currently happening in CI, but all on Windows.
Unsure if its also happening in directly in editor as the error would not have any consequences there.
The .sentry-native cache is not stored under content right?
The .sentry-native cache is not stored under content right?
No, it should be either project's root dir or project's user dir (FPaths::ProjectUserDir())