sentry-unreal icon indicating copy to clipboard operation
sentry-unreal copied to clipboard

Occasional Error log during build "LogSentrySdk: Error: Sentry initialization failed"

Open Darkere opened this issue 8 months ago • 7 comments

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

  1. Start Cook
  2. Randomly run into error
  3. 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 avatar Mar 12 '25 07:03 Darkere

@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.

tustanivsky avatar Mar 12 '25 08:03 tustanivsky

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 avatar Mar 12 '25 09:03 Darkere

@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.)?

tustanivsky avatar Mar 17 '25 13:03 tustanivsky

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?

Darkere avatar Apr 03 '25 07:04 Darkere

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.

tustanivsky avatar Apr 04 '25 06:04 tustanivsky

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?

Darkere avatar Apr 04 '25 07:04 Darkere

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())

tustanivsky avatar Apr 04 '25 07:04 tustanivsky