Skip to content

Android Symbolicated Stack Trace points to a wrong line #3121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
5 of 11 tasks
HariWarshan opened this issue Jun 14, 2023 · 9 comments
Closed
5 of 11 tasks

Android Symbolicated Stack Trace points to a wrong line #3121

HariWarshan opened this issue Jun 14, 2023 · 9 comments

Comments

@HariWarshan
Copy link

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

  • @sentry/react-native (>= 1.0.0)
  • react-native-sentry (<= 0.43.2)

react-native version: 0.68.2

Are you using Expo?

  • Yes
  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)
  • on-premise

Configuration:

(@sentry/react-native)

Sentry.init({
  dsn: 'https://[email protected]/...'
   environment: "production",
    tracesSampleRate: 1,
    enableAutoSessionTracking: true,
      release: `${AppConstant.APP_NAME}@${AppConstant.APP_VERSION }`
     dist: AppConstant.APP_BUILD,
    enableNative: true,
    attachScreenshot: true,
    integrations: [new Sentry.ReactNativeTracing()]
});

I have following issue:

[Description]
I did uploaded the stack trace but noticed The trace for this event cannot be found

Steps to reproduce:

  • I am creating bundle files with react-native bundle --dev false --platform android --entry-file index.js --bundle-output index.android.bundle --sourcemap-output index.android.bundle.map
  • uploading them using ./node_modules/@sentry/cli/bin/sentry-cli --log-level=debug releases --org <org_name> --project <project_name> files $APP_NAME@$APP_VERSION upload-sourcemaps --dist $BUILD_NUMBER --strip-prefix index.js --rewrite index.android.bundle index.android.bundle.map
  • i can able to see the sourcemaps thats uploaded in archives
    Screenshot 2023-06-14 at 8 54 29 AM
  • trigger exception manually using Sentry.captureException("Test Capture Exception")

Actual result:

  • i am noticing this messageThe trace for this event cannot be found on that particular event
    Screenshot 2023-06-14 at 8 58 55 AM
  • when i do sentry-cli sourcemaps explain, am getting Event exception stacktrace selected frame (0) has incorrect abs_path (valid url is required).
Screenshot 2023-06-14 at 9 00 54 AM

Expected result:
sourcemap should be linked to the events and i should be able to identify the exact line where the exception happened

@krystofwoldrich
Copy link
Member

Hi, thank you for the message,
can you open the event JSON on the issue page and search for exception -> values -> raw_stacktrace -> frames -> abs_path and share some (or best all if they are different) abs_path paths examples with us?

@HariWarshan
Copy link
Author

@krystofwoldrich i can see "abs_path": "app:///index.android.bundle" in all frames

@krystofwoldrich
Copy link
Member

Are you using RN SDK older than 5.1.1?

Likely you need this fix #2891

Can you upgrade to the latest SDK version?

@HariWarshan
Copy link
Author

HariWarshan commented Jun 14, 2023

@sentry/react-native version is not older than 5.1.1 here are the versions

@sentry/react-native: 5.5.0, 
react-native: 0.68.2

@krystofwoldrich
Copy link
Member

I'm looking back at this screen the stack frames look symbolicated, what exactly is the issue here?

@HariWarshan
Copy link
Author

This is an exception which is triggered to test if the events are being logged in sentry
Sentry.captureException("Test Capture Exception")

also i can share the event-id 82c922bfbf844e6e948dc00e346b9011

@krystofwoldrich
Copy link
Member

@HariWarshan Thank you, I see now, the stack trace doesn't point to the correct file and line of code.

Are you using Hermes?

@krystofwoldrich krystofwoldrich changed the title The trace for this event cannot be found. Android Symbolicated Stack Trace points to the wrong line Jun 16, 2023
@krystofwoldrich krystofwoldrich changed the title Android Symbolicated Stack Trace points to the wrong line Android Symbolicated Stack Trace points to a wrong line Jun 16, 2023
@HariWarshan
Copy link
Author

yes, we are using Hermes. @krystofwoldrich

@krystofwoldrich
Copy link
Member

Okay, I see,
you need to create Hermes combined source map.

npx react-native bundle --platform android --dev false --entry-file index.js --reset-cache --bundle-output index.android.bundle --sourcemap-output index.android.bundle.packager.map --minify false

node_modules/hermes-engine/{OS-BIN}/hermesc -O -emit-binary -output-source-map -out=index.android.bundle.hbc index.android.bundle
rm -f index.android.bundle
mv index.android.bundle.hbc index.android.bundle

node node_modules/react-native/scripts/compose-source-maps.js index.android.bundle.packager.map index.android.bundle.hbc.map -o index.android.bundle.map

More details about the command https://docs.sentry.io/platforms/react-native/manual-setup/hermes/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Archived in project
Development

No branches or pull requests

2 participants