You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Sentry fails to initialize in Blazor with AoT enabled #3263
Web app loads properly and starts up. This works fine when using Sentry.Extensions.Logging3.41.4 but breaks after doing the major upgrade to 4.
Actual Result
Web app fails to load
Error: AggregateException_ctor_DefaultMessage (sentry-native)
at Jn (dotnet.runtime.8.0.3.b85ar3xvhg.js:3:31614)
at xl (dotnet.runtime.8.0.3.b85ar3xvhg.js:3:182162)
at dotnet.native.wasm:0xb7f885
at dotnet.native.wasm:0xb8125f
at dotnet.native.wasm:0xb86cc5
at dotnet.native.wasm:0xe6866
at dotnet.native.wasm:0x130d162
at dotnet.native.wasm:0x132a1bb
at dotnet.native.wasm:0x1309ad4
at dotnet.native.wasm:0x12fced1
Confirming that I can reproduce this when building and running in docker.
Debug: Logging enabled with ConsoleDiagnosticLogger and min level: Debug
dotnet.native.8.0.4.xlcgqfj2gk.js:8 Warning: Sentry option 'Debug' is set to true while Environment is production. Be aware this can cause performance degradation and is not advised. See https://docs.sentry.io/platforms/dotnet/configuration/diagnostic-logger for more information
dotnet.native.8.0.4.xlcgqfj2gk.js:8 Error: Failure getting precise App startup time.
dotnet.native.8.0.4.xlcgqfj2gk.js:8 System.PlatformNotSupportedException: Process_PlatformNotSupported
dotnet.native.8.0.4.xlcgqfj2gk.js:8 at Sentry.Internal.ProcessInfo.GetStartupTime()
dotnet.native.8.0.4.xlcgqfj2gk.js:8 at Sentry.Internal.ProcessInfo.<>c__DisplayClass15_1.<.ctor>b__0()
blazor.webassembly.js:1 Error: AggregateException_ctor_DefaultMessage (sentry-native)
at Jn (dotnet.runtime.8.0.4.17vw47cxz6.js:3:31614)
at xl (dotnet.runtime.8.0.4.17vw47cxz6.js:3:182261)
at dotnet.native.wasm:0xb7f885
at dotnet.native.wasm:0xb8125f
at dotnet.native.wasm:0xb86cc5
at dotnet.native.wasm:0xe6866
at dotnet.native.wasm:0x130d162
at dotnet.native.wasm:0x132a1bb
at dotnet.native.wasm:0x1309ad4
at dotnet.native.wasm:0x12fced1
If Sentry is not initialized when running in Docker, everything works as expected.
Also if AOT is disabled (setting <RunAOTCompilation>false</RunAOTCompilation> in the csproj file) then everything works as expected.
Given that it only occurs when running AOT compiled code in Docker, it's relatively difficult to debug.
It looks like we're getting a PlatformNotSupportedException from somewhere in the ProcessInfo constructor...
Dang, dead end... all of that is just this (which is wrapped in a try catch and logging the exception - it won't be what's crashing the process then) 😞 :
@bitsandfoxes may I ask for an update? It has been over a month now where this critical bug has not been fixed. There is a bit of irony to it, given that Sentry proudly announced AoT support in v4 for non-console apps (which is not working) while having working AoT in v3 without any trouble.
It's a bit underwhelming to see no real progress on this issue even though I provided a one-click repro in my initial post giving you all the information you could desire.
@bitsandfoxes great to see that this got fixed. Is this going to be released as a patch or do we need to wait for the next minor release? And if so, is there any timeline/release cycle for this?
Activity
[-]Sentry fails on Blazor with AoT enabled[/-][+]Sentry fails to initialize in Blazor with AoT enabled[/+]bitsandfoxes commentedon Apr 8, 2024
Thanks, @klemmchr for the detailed issue and the repro in particular!
jamescrosswell commentedon Apr 16, 2024
Confirming that I can reproduce this when building and running in docker.
If Sentry is not initialized when running in Docker, everything works as expected.
Also if AOT is disabled (setting
<RunAOTCompilation>false</RunAOTCompilation>in the csproj file) then everything works as expected.Given that it only occurs when running AOT compiled code in Docker, it's relatively difficult to debug.
It looks like we're getting a
PlatformNotSupportedExceptionfrom somewhere in theProcessInfoconstructor...jamescrosswell commentedon Apr 16, 2024
OK so it might be this:
sentry-dotnet/src/Sentry/Internal/ProcessInfo.cs
Line 119 in 790e40d
Apparently that method can throw a
PlatformNotSupportedException:And we are calling that in the constructor:
sentry-dotnet/src/Sentry/Internal/ProcessInfo.cs
Line 97 in 790e40d
jamescrosswell commentedon Apr 16, 2024
Dang, dead end... all of that is just this (which is wrapped in a try catch and logging the exception - it won't be what's crashing the process then) 😞 :
sentry-dotnet/src/Sentry/Internal/ProcessInfo.cs
Lines 100 to 108 in 790e40d
bitsandfoxes commentedon Apr 22, 2024
After our sync: We think we should disable
sentry-nativewhen targeting Blazor.klemmchr commentedon Apr 22, 2024
Is there any ETA on when this fix can be expected? I'm desperate to update the SDK to v4.
2 remaining items
bitsandfoxes commentedon Apr 22, 2024
Doubleconfirming: I can reproduce this locally with our own Blazor.Wasm sample outside of docker. A fix should follow shortly.
klemmchr commentedon May 9, 2024
@bitsandfoxes may I ask for an update? It has been over a month now where this critical bug has not been fixed. There is a bit of irony to it, given that Sentry proudly announced AoT support in v4 for non-console apps (which is not working) while having working AoT in v3 without any trouble.
It's a bit underwhelming to see no real progress on this issue even though I provided a one-click repro in my initial post giving you all the information you could desire.
bitsandfoxes commentedon May 10, 2024
Hey @klemmchr, sorry about that. The issue fell through the cracks. We'll pick it back up and you can expect a fix early next week.
klemmchr commentedon May 13, 2024
@bitsandfoxes great to see that this got fixed. Is this going to be released as a patch or do we need to wait for the next minor release? And if so, is there any timeline/release cycle for this?
bitsandfoxes commentedon May 14, 2024
Hey @klemmchr, it's part of
4.6.1that's coming out right now. (or whenever CI is done doing its thing)