sentry-unity
sentry-unity copied to clipboard
Sentry: (Error) Failed to resolve persistent installation ID. System.UnauthorizedAccessException: Access to the path "xxxxxxx" is denied.
Environment
How do you use Sentry? Sentry SaaS (sentry.io)
Which version of the SDK? 0.23.1
How did you install the package? (Git-URL, Assetstore) Git-URL
Which version of Unity? 2020.3.13f
Is this happening in Unity (editor) or on a player like Android, iOS, Windows? Android and iOS
Steps to Reproduce
Sentry Initialization Programmatically
Expected Result
No errors thrown
Actual Result
Sentry: (Error) Failed to resolve persistent installation ID. System.UnauthorizedAccessException: Access to the path "xxxxxx" is denied. Sentry: (Error) Failed to find an appropriate network interface for installation ID. -> This line JUST ON iOS
Hey @ArnauKokoro, thanks for reporting this. I assume when you're initializing the SDK you're not setting the CacheDirectoryPath
?
It looks like the Session Tracking is at fault here. But the SDK should definitely not create errors due to this.
You could work around this error for now, by setting AutoSessionTracking = false
.
Hi @bitsandfoxes,
I'm not setting CacheDirectoryPath. What's happend if I disable AutoSessionTracking because I had it enabled on other SDK versions?
I assumed your intention was to disable all offline caching. You could set the CacheDirectoryPath
yourself, the SDK defaults to Application.PersistentDataPath
.
If you disable AutoSessionTracking
the SDK will no longer send information about release health i.e. crash-free rate e.t.c.
Hi @bitsandfoxes
I see...I need that AutoSessionTracking.
So...to avoid that error I should add a CacheDirectoryPath? What's a normal CacheDirectoryPath for Android and iOS?
Many thanks!
Hi @bitsandfoxes,
Got it fixed with this workaround:
What I did is set Application.temporaryCachePath as a CacheDirectoryPath on the programmatically initial options and keep AutoSessionTracking enabled.
With these options the error not occurs.
Thanks!
Thanks for confirming the workaround.
That this is failing for you is quite surprising to me though. As mentioned above, we set the default value to Application.persistentDataPath
and this seems to work fine on all platforms. Can you confirm the path in the error you mentioned above (Sentry: (Error) Failed to resolve persistent installation ID. System.UnauthorizedAccessException: Access to the path "xxxxxx"
) looked like the path in the Unity docs for the given platform?
edit: I've missed this is because of the programmatic initialization - yeah, that makes sense and that's an issue we can do something about.
Thanks again @ArnauKokoro. We're tracking this issue over here: https://github.com/getsentry/sentry-unity/issues/1025