sentry-react-native: Uploaded Android bundle is 0MB and event processing keeps failing due to it

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

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

SDK version: 4.10.1

react-native version: 0.70.6

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:

https://sentry.io/organizations/stampix-zb/issues/3496972388/?project=6259211&query=is%3Aunresolved+os.name%3AAndroid&referrer=issue-stream&statsPeriod=14d

Configuration:

(@sentry/react-native)

Sentry.init({
  dsn: 'https://...@sentry.io/...'
  // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
  // We recommend adjusting this value in production.
  tracesSampleRate: SENTRY_TRACING_RATE,
  enableNdkScopeSync: true,
  integrations: [
    new Sentry.ReactNativeTracing({
      // Pass instrumentation to be used as `routingInstrumentation`
      routingInstrumentation
      // ...
    })
  ],
  environment: SENTRY_ENVIRONMENT,
  // Any data beyond this depth will be trimmed and marked using its type instead ([Object] or [Array]).
  normalizeDepth: 10,
  beforeBreadcrumb: (breadcrumb, hint) => {
    // We log some more information for XHR requests to our GQL API, since only the method and URL is useless for debugging
    if (breadcrumb.category === 'xhr' && hint) {
      try {
        const { query, variables } = JSON.parse(hint.input);
        if (!breadcrumb.data) breadcrumb.data = {};
        breadcrumb.data.query = query;
        breadcrumb.data.variables = variables;
      } catch {}
    }
    return breadcrumb;
  },
  maxValueLength: 500,
  // Don't auto initialize, instead we do it manually
  // See https://docs.sentry.io/platforms/react-native/manual-setup/native-init/
  autoInitializeNativeSdk: false
});

Note that we’ve just now disabled auto initialization, the issue at hand was present before we did disabled this.


I have following issue:

Every new release suddenly started having empty Android bundles, giving us the Invalid location in sourcemap errors at the top of Android-reported events. Using the Sentry CLI to debug the particular events reveals the same and the sourcemap uploads in the project Settings also clearly shows it’s empty (see screenshot). image

Note that this used to work in the past, but it’s hard to debug where it started occurring since the older events are long removed due to retention periods.

For iOS, this works perfectly and all is well.

Steps to reproduce: Just make a release bundle, which automatically uploads the bundle to our Sentry environment.

Actual result:

Minified stack traces in our events and an error banner on top.

Expected result:

Proper reported events with stack traces

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

@StampixSMO being 0 bytes is fine I don’t remember if for Hermes or RAM bundles, have to check it. @krystofwoldrich will further investigate.

I will close this for now. But please comment down below when you get back to it and we can reopen it and investigate more.

@krystofwoldrich No, I’ve been out and haven’t been able to look into the diff. On my TODOs!

@krystofwoldrich Is it normal that the bundle is 0MB?

Yes, as mentioned here https://github.com/getsentry/sentry-react-native/issues/2683#issuecomment-1344063151 Its for Hermes apparently, @krystofwoldrich please add a note to https://docs.sentry.io/platforms/react-native/manual-setup/hermes/ that being 0 bytes on Android is fine.

About the issue, @StampixSMO please take a look into @krystofwoldrich questions https://github.com/getsentry/sentry-react-native/issues/2683#issuecomment-1354731167

@StampixSMO Sadly I don’t know what to do at this moment. The only suggestion I have is to compare the newly created project to the original one and try to find the differences in settings, RN version, etc.

A minimal reprocible exampe would do, that means.

npx react-native init Name
yarn add @sentry/react-native
npx @sentry/wizard -i reactNative -p ios android

Steps to reproduce…

Allow me some time to set this up and try to reproduce, be back soon.