Skip to content
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

Stack traces not showing correctly in IOS production build #3825

Closed
5 of 11 tasks
leocpadua7 opened this issue May 17, 2024 · 1 comment
Closed
5 of 11 tasks

Stack traces not showing correctly in IOS production build #3825

leocpadua7 opened this issue May 17, 2024 · 1 comment

Comments

@leocpadua7
Copy link

OS:

  • Windows
  • macOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

  • @sentry/react-native (^5.20.0)
  • react-native-sentry (<= 0.43.2)

SDK version: RNSentry (5.20.0)

react-native version: 0.70.14

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:


I have the following issue:

We've just updated @sentry/react-native from 3.1.1 to 5.20.0. And, after following the documentation and troubleshooting guide, our iOS production stack traces weren’t pointing the error correctly.

We found that the problem was the debug files upload script modifications. We use the sentry-cli upload-dsymcommand, but the docs: says "Note, that upload-dsym has been replaced by debug-files upload and requires a path".
Our code was:

#!/bin/sh

export NODE_BINARY=node

if [[ "${SENTRY_ENABLED}" == "true" ]]; then
    echo "Uploading debug symbols to sentry"
    export SENTRY_PROPERTIES=sentry.properties
    ../../node_modules/@sentry/cli/bin/sentry-cli upload-dsym
fi

and we updated to:

#!/bin/sh

export NODE_BINARY=node

if [[ "${SENTRY_ENABLED}" == "true" ]]; then
    echo "Uploading debug symbols to sentry"
    export SENTRY_PROPERTIES=sentry.properties
    ../../node_modules/@sentry/cli/bin/sentry-cli debug-files upload "$DWARF_DSYM_FOLDER_PATH"
fi

--

Furthermore, we've also updated the source maps build step, as pointed in the documentation, but it also didn’t work.
Our code was:

#!/bin/sh
set -e
export WITH_ENVIRONMENT="../../node_modules/react-native/scripts/xcode/with-environment.sh"
export REACT_NATIVE_XCODE="../../node_modules/react-native/scripts/react-native-xcode.sh"
export PROJECT_ROOT=..
export SENTRY_PROPERTIES=sentry.properties
export EXTRA_PACKAGER_ARGS="--sourcemap-output $DERIVED_FILE_DIR/main.jsbundle.map"
export SENTRY_CLI_PATH="../../node_modules/@sentry/cli/bin/sentry-cli"

if [[ "${SENTRY_ENABLED}" == "true" ]]; then
    echo "Sentry integration is enabled"
    $WITH_ENVIRONMENT "$SENTRY_CLI_PATH react-native xcode $REACT_NATIVE_XCODE"
else
	$WITH_ENVIRONMENT $REACT_NATIVE_XCODE
fi

and we updated it to:

#!/bin/sh
set -e
export WITH_ENVIRONMENT="../../node_modules/react-native/scripts/xcode/with-environment.sh"
export REACT_NATIVE_XCODE="../../node_modules/react-native/scripts/react-native-xcode.sh"
export SENTRY_XCODE="../../node_modules/@sentry/react-native/scripts/sentry-xcode.sh"
export BUNDLE_REACT_NATIVE="/bin/sh $SENTRY_XCODE $REACT_NATIVE_XCODE"
export PROJECT_ROOT=..
export SENTRY_PROPERTIES=sentry.properties
export EXTRA_PACKAGER_ARGS="--sourcemap-output $DERIVED_FILE_DIR/main.jsbundle.map"
export SENTRY_CLI_PATH="../../node_modules/@sentry/cli/bin/sentry-cli"

if [[ "${SENTRY_ENABLED}" == "true" ]]; then
    echo "Sentry integration is enabled"
    /bin/sh -c "$WITH_ENVIRONMENT \"$BUNDLE_REACT_NATIVE\" $SENTRY_CLI_PATH"
else
	$WITH_ENVIRONMENT $REACT_NATIVE_XCODE
fi

--

After some investigation, we've found out that even with the sentry update, the unmodified scripts still worked correctly, and the stack traces were showing up as expected. We decided to continue the update without these “updated scripts” to comply with the apple privacy manifest update.

So, we have two main questions here:

  1. Is there any missing configuration needed in the updated code snippets?
  2. Will the upload-dsym command be depreciated anytime soon? The docs and changelog points to the depreciation, but it seems to still work as expected.

Steps to reproduce:

Actual result:

Actual result

Expected result:

Expected result

@krystofwoldrich
Copy link
Member

krystofwoldrich commented May 27, 2024

Hi @leocpadua7,

thank you for the message, excuse the slower response caused by the ongoing conferences,

  1. The upload-dsym command will likely be removed in the next major version of Sentry CLI. You can update to our new debug files upload script, similar to sentry-xcode.sh.
/bin/sh ../../node_modules/@sentry/react-native/scripts/sentry-xcode-debug-files.sh

The upload can be disabled by SENTRY_DISABLE_AUTO_UPLOAD=true.

  1. The source maps upload EXTRA_PACKAGER_ARGS should not be used in favor of SOURCEMAP_FILE which is set automatically by sentry-xcode.sh.
set -e
export WITH_ENVIRONMENT="../../node_modules/react-native/scripts/xcode/with-environment.sh"
export REACT_NATIVE_XCODE="../../node_modules/react-native/scripts/react-native-xcode.sh"
export SENTRY_XCODE="../../node_modules/@sentry/react-native/scripts/sentry-xcode.sh"
export BUNDLE_REACT_NATIVE="/bin/sh $SENTRY_XCODE $REACT_NATIVE_XCODE"
export PROJECT_ROOT=..
export SENTRY_CLI_EXECUTABLE="../../node_modules/@sentry/cli/bin/sentry-cli"

/bin/sh -c "$WITH_ENVIRONMENT \"$BUNDLE_REACT_NATIVE\""

The sentry-xcode.sh script uses SENTRY_CLI_EXECUTABLE replacing SENTRY_CLI_PATH. Auto upload can be disabled by SENTRY_DISABLE_AUTO_UPLOAD, therefore the if guard is not needed.

Let us know if these recommended scripts worked for you? If not feel free to comment here and we can reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Status: Done
Development

No branches or pull requests

2 participants