getsentry / sentry-unity

Development of Sentry SDK for Unity
https://docs.sentry.io/platforms/unity/
MIT License
208 stars 50 forks source link

Crash reports on Windows player with Mono run time use Windows-style paths and cannot be associated with source code #1764

Closed wilg closed 1 month ago

wilg commented 2 months ago

Environment

How do you use Sentry? Sentry SaaS (sentry.io)

Which version of the SDK? sentry-unity 2.1.3

How did you install the package? (Git-URL, Assetstore) Git

Which version of Unity? 6000.0.14f1

Is this happening in Unity (editor) or on a player like Android, iOS, Windows? Player

Steps to Reproduce

Any crash.

Expected Result

Sentry shows my source code as configured through the Code Mapping in the Github Integratinon.

Actual Result

This is the full "Raw Stack Trace" that appears in Sentry.

Newest

System.ArgumentNullException: Value cannot be null.
Parameter name: value
  Module "StorytellerSaveManager", in CurrentSaveGame
  Module "StorytellerSaveManager", in SwitchScene
  Module "InteractableSceneTransition", in DidTrigger
  Module "InteractableTrigger", in CompleteTrigger
  Module "InteractableTrigger", in Trigger
  Module "InteractableManager", in InteractButtonPress
  Module "InteractableManager", in Interact1ButtonPress
  Module "ButtonHoldHandler", in OnPerformed
  Module "UnityEngine.InputSystem.Utilities.DelegateHelpers", in InvokeCallbacksSafe

Source files are not associated. I think this may be due to the Windows style paths, which other sentry SDKs may normalize? Not sure the expected approach here.

Image

I have a potentially related issue with my Mac players, but those do not show file and line numbers at all. https://github.com/getsentry/sentry-unity/issues/1763

bitsandfoxes commented 2 months ago

Hey @wilg, sorry to see you run into troubles. Are you opting in uploading sources to Sentry in the sentry-cli options as well?

tustanivsky commented 1 month ago

Hi @wilg, did you add any custom code mappings for the existing GitHub integration (Organization Settings > Integrations > Configure GitHub)? These should help link Sentry stack trace to the corresponding file in your source code so that you can easily navigate between them. For instance, here's the code mapping example that works on Windows (Assets folder is located in GitHub repo root):

Image

Also, did you try to enable Upload Sources option in Unity? Having it opted in will allow you to display relevant code right next to stack trace at the event's page.

wilg commented 1 month ago

Hey, thanks! I think I had an error in the code mapping setup, and I did not realize that the code mapping was insufficient to show source inline. I thought the GitHub integration would do that, but I will try with Upload Sources enabled.