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
Application crashes on Nintendo Switch when reporting an error via Sentry #1804
It seems like the issue is that even when the above options are set, it still tries to use TryGetPersistentInstallationId which will always crash since files & directories cannot be created on the platform.
The error log that appears in the console when it generates a dump:
Error: nn::fs::CreateDirectory() failed because the operation is unsupported.
Search '2002-6364' on the following Error Code List for more information.
https://developer.nintendo.com/html/online-docs/g1kr9vj6-ja/Packages/Docs/Lists/ErrorCodeList/NintendoSwitch-ErrorCodeList-ja/2002.html
https://developer.nintendo.com/html/online-docs/g1kr9vj6-en/Packages/Docs/lists/NintendoSwitch-ErrorCodeList/2002.html
------------
AbortObserver called: Failed: nnFsResult
Module: 2
Description: 6364
InnerValue: 0x0031b802
Condition: nn::Result::IsSuccess()
Function: CreateDirectory in D:\home\teamcity\work\sdk\Programs\Chris\Sources\Libraries\fs\fsa\fs_UserFileSystem.cpp:58
Sorry to see you run into issues @abond-sd.
This should work out-of-the-box. We're handling platform-restrictions for unknown platforms (i.e. Switch) here:
On a side note: Build-Time Configuration is there to allow the configuration of the native SDKs at build time (those options cannot be changed at runtime) We're planning to simplify this and tracking it with #1621
So if you want to explicitly disable feature on the Switch you'd have to configure those in the RuntimeConfiguration.
Reading through the crashlog it looks like trying to fetch the Installation ID the .NET SDK attempts to create a persistent installation ID. This is definitely a bug then. Thanks for raising this!
Hey @abond-sd, we've identified the root cause and working on a fix in the .NET SDK. Could you confirm for us: Is the SDK allowed to read from disk? I.e. if you were to attach a log file, would that cause a crash too? Is the restriction for the SDK limited to writing to disk?
Sorry to see you run into issues @abond-sd. This should work out-of-the-box. We're handling platform-restrictions for unknown platforms (i.e. Switch) here:
private void HandlePlatformRestrictions(SentryUnityOptions options, IApplication application, ISentryUnityInfo? unityInfo)
On a side note: Build-Time Configuration is there to allow the configuration of the native SDKs at build time (those options cannot be changed at runtime) We're planning to simplify this and tracking it with #1621 So if you want to explicitly disable feature on the Switch you'd have to configure those in the RuntimeConfiguration.
Thanks, I didn't see a way to affect the behavior of the installation id through something like this, unfortunately. The only related option I could see was SentryOptions.CacheDirectoryPath but since Switch isn't permitted disk access anyway, it doesn't help, unfortunately.
Hey @abond-sd, we've identified the root cause and working on a fix in the .NET SDK. Could you confirm for us: Is the SDK allowed to read from disk? I.e. if you were to attach a log file, would that cause a crash too? Is the restriction for the SDK limited to writing to disk?
I don't believe the standard .NET directory or file APIs work out of the box on the platform. You generally seem restricted to reading from readonly storage or reading/writing save data via different Switch SDK calls.
We added the following to our runtime configuration in a attempt to prevent the generating of installation id. Our understanding was that an installationid is requested when there is a null value for SentryUser.Id. However, the fix pasted here does not prevent the generation (and subsequent saving to disk) of an installation id.
SentrySdk.ConfigureScope(scope =>
{
scope.User = new SentryUser
{
// This fixes a crash on consoles because when not set, Sentry would generate an identifier
// and try to save that off to a file. But alas, on most consoles, writable directories
// are not readily available nor does all of System.IO work properly. Setting this to a
// non-null values indicates to Sentry that it does not need to generate and save it's own identifer
Id = string.Empty
};
});
We're putting a proper fix for this into the underlying .NET SDK to control - and in case of the Switch platform disable out of the box - the file IO operations.
We're putting a proper fix for this into the underlying .NET SDK to control - and in case of the Switch platform disable out of the box - the file IO operations.
Activity
bitsandfoxes commentedon Sep 13, 2024
Sorry to see you run into issues @abond-sd.
This should work out-of-the-box. We're handling platform-restrictions for
unknownplatforms (i.e. Switch) here:sentry-unity/src/Sentry.Unity/ScriptableSentryUnityOptions.cs
Line 238 in f4e129b
On a side note: Build-Time Configuration is there to allow the configuration of the native SDKs at build time (those options cannot be changed at runtime) We're planning to simplify this and tracking it with #1621
So if you want to explicitly disable feature on the Switch you'd have to configure those in the
RuntimeConfiguration.bitsandfoxes commentedon Sep 13, 2024
Reading through the crashlog it looks like trying to fetch the
Installation IDthe .NET SDK attempts to create a persistent installation ID. This is definitely a bug then. Thanks for raising this!bitsandfoxes commentedon Sep 13, 2024
Hey @abond-sd, we've identified the root cause and working on a fix in the .NET SDK. Could you confirm for us: Is the SDK allowed to read from disk? I.e. if you were to attach a log file, would that cause a crash too? Is the restriction for the SDK limited to writing to disk?
abond-sd commentedon Sep 13, 2024
Thanks, I didn't see a way to affect the behavior of the installation id through something like this, unfortunately. The only related option I could see was SentryOptions.CacheDirectoryPath but since Switch isn't permitted disk access anyway, it doesn't help, unfortunately.
I don't believe the standard .NET directory or file APIs work out of the box on the platform. You generally seem restricted to reading from readonly storage or reading/writing save data via different Switch SDK calls.
ogonzalez-sd commentedon Sep 13, 2024
We added the following to our runtime configuration in a attempt to prevent the generating of installation id. Our understanding was that an installationid is requested when there is a null value for SentryUser.Id. However, the fix pasted here does not prevent the generation (and subsequent saving to disk) of an installation id.
ogonzalez-sd commentedon Sep 13, 2024
To put a finer detail, whatever string returned by "Environment.SpecialFolder.LocalApplicationData" on Nintendo Switch, is not a writable directory
bitsandfoxes commentedon Sep 16, 2024
We're putting a proper fix for this into the underlying .NET SDK to control - and in case of the Switch platform disable out of the box - the file IO operations.
abond-sd commentedon Sep 16, 2024
Sounds great, thank you!