sentry-react-native: Multiple tracking.enable$argument_0.onUnhandled error reported

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

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

SDK version: 5.5.0

react-native version: 0.69.10

Are you using Expo?

  • Yes
  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)
  • on-premise

If you are using sentry.io, please post a link to your issue so we can take a look:

[Link to issue]

Configuration:

(@sentry/react-native)

  Sentry.init({
    dsn: 'redacted',
    enableAutoSessionTracking: true,
    environment: config.environment,

    ignoreErrors: [
      // Axios throw error from createError.js, please see useFetch for error log
      /Request\sfailed\swith\sstatus\scode.*/,
      // react-native-fingerprint-scanner
      /.*biometric.*/,
      // appsflyer
      /.*inapps\.appsflyer\.com.*/,
      /.*com\.appsflyer\.sdk\.network.*/,
    ],

    integrations: [
      new Sentry.ReactNativeTracing({
        enableUserInteractionTracing: true,
        routingInstrumentation,
        shouldCreateSpanForRequest: url => {
          const urlRedacted = /redacted/;
          const urlLocalhost = /localhost/;

          return !url.match(urlRedacted) && !url.match(urlLocalhost);
        },
        // ... other options
      }),
    ],

    sampleRate: 0.2,
    // Sessions close after app is 10 seconds in the background.
    sessionTrackingIntervalMillis: 10000,
    tracesSampleRate: 0.2,
  });

I have following issue:

[Description]

I saw issue being logged on Sentry that related to error reporting. Not sure what caused this issues.

tracking.enable$argument_0.onUnhandled


image

Actual result:

[Actual result]

Expected result:

No issues related to sentry reported

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 4
  • Comments: 33 (13 by maintainers)

Most upvoted comments

For me it also happens on Android. 8 users with 291 events. RN 0.71.13, Sentry 5.9.1. I could not reproduce it locally.

@isinuyk Since you mentioned it’s iOS only, could it be incorrect source maps causing the issue, are your other iOS JS errors source mapped correctly?

I don’t think so. It is an example of another issue within the same release which has the correct source map

<div></div>

As a final FYI, I also just saw that RN 0.72.7 includes the following fix:

Show correct stack frame on unhandled promise rejections on development mode. https://github.com/facebook/react-native/commit/18c9797ecc8dab220ec68aae011ddb73db17a99d

While I didn’t look at the code it could be related. Thanks again

We are also seeing this error on iOS right after Codepush installs a bundle and it causes the app to crash. We can replicate this ~50% of the time on one of our devices by a) freshly installing the app b) selecting “Install” on the Codepush prompt*. Skipping b) means that the app does not crash. I am not sure if this is caused by Sentry, but I thought I would report my findings.

The stack trace, which similar to the above seems to start here:

  1. in callFunctionReturnFlushedQueue
  2. Then this invariant seems to trigger in line 428: Failed to call into JavaScript module method ${module}.${method}(). Module exists, but the method is undefined. This would further suggest that it’s related to Codepush. For example, Codepush invalidates all RCTBridges when it restarts (which happens when a new bundle is installed.)

The one thing that doesn’t fit the above, is that I don’t see this error message anywhere. Maybe invariant is not creating the error in a way that is compatible with sentry. Maybe “Error: 1” comes from here?

image

* Our codepush config checks for updates when the app starts, and asks the user whether they want to upgrade; if you press “Install”, we install the new bundle immediately. Config: {checkFrequency: codePush.CheckFrequency.ON_APP_RESUME, installMode: codePush.InstallMode.IMMEDIATE,updateDialog: {}}

Facing the same issue on iOS. For us started coincidentally when we updated RN 0.70.9 to 0.70.13. I’m not able to reproduce the issue and can confirm it only happens on release builds

"react-native": "^0.71.14", "@sentry/react-native": "^5.4.0",

Screenshot 2023-11-08 at 2 17 36 PM

@Kowaio Thank you for the information, we will keep you posted on any updates regarding this issue.

Thanks for the message, are your other errors in Sentry symbolicated correctly?

Recently I receiving from time to time not readable SIGABRT errors. But some error still readable.

Example
OS Version: Android 7.1.1 (ONEPLUS A5000_23_171031)
Report Version: 104

Exception Type: Unknown (SIGABRT)

Application Specific Information:
Abort

Thread 0 Crashed:
0   [vdso]                          0xcdfbed91          __kernel_vsyscall
1   libc.so                         0xc95f623c          tgkill
2   libc.so                         0xc95f1a15          pthread_kill
3   libc.so                         0xc95a2a7a          raise
4   libc.so                         0xc9599ee6          abort
5   libstagefright.so               0xcc0e691c          android::MPEG4Writer::Track::getStartTimeOffsetScaledTime
6   libstagefright.so               0xcc0e4e96          android::MPEG4Writer::Track::writeSttsBox
7   libstagefright.so               0xcc0e4386          android::MPEG4Writer::Track::writeStblBox
8   libstagefright.so               0xcc0dbb8a          android::MPEG4Writer::Track::writeTrackHeader
9   libstagefright.so               0xcc0dae51          android::MPEG4Writer::writeMoovBox
10  libstagefright.so               0xcc0d8c19          android::MPEG4Writer::reset
11  libstagefright.so               0xcc0e7d30          android::MPEG4Writer::stop
12  libstagefright.so               0xcc11078f          android::MediaMuxer::stop
13  libmedia_jni.so                 0xbd7d763f          <unknown> + 3179116095
14  system@framework@boot-framework.oat0x72f5dfbe          oatexec

Still trying to replicate this on release build (when building on my local device). Here are sentry log however:

Screenshot 2023-08-30 at 10 14 25 am

Screenshot 2023-08-30 at 10 14 45 am

Note: I have hermes enabled. on iOS only.

I have noticed this happening during the app startup (at-least that’s what i see in the screenshot that the sentry shows)

Noticed this on iPhone 11 , iPhone 8 Arch:arm64 iOS Version:16.6 (from the error logs that we been getting). and it is handled (not crashing the app).

I will post something in this post, in-case i find more / able to replicate

@NiharR27 Thank you for the information, would you be able to narrow it down? Or share a minimal reproducible example?

@krystofwoldrich sure, i will try to replicate once I get to the office tomorrow. Additionally, I have also updated the last comment to mention what changes we made recently before pushing (after which the above started)